A class that represents a Process Flow token.
|Gets a reference to the token's current activity.
|Gets the rank of the child token.
|Accesses the token's children.
|Gets or sets the color of the token.
|Gets the model time of when the token entered its current activity.
|Gets the token's unique ID.
|Gets the token's Process Flow instance.
|Use your own named properties to get/set label values.
|Accesses a node's labels as nodes.
|Gets and sets the token's name.
|Gets the token's parent.
|Gets the token's Process Flow object.
|Gets the number of stops for the token.
|Gets the token associated with the id.
|Releases the token from its current activity.
|Removes a stop from the token.
|Deprecated. Use the color property. Sets the color of the token.
|Sets the shape of the token.
|Adds a stop to the token
|Creates a token and places it inside the activity for the given owner object (instance).
Accesses the token's children.
Accessing the Number of Children
You can access the number of children on the token with the following code.
Accessing Children by Rank
You can access an individual child token by rank with the following code.
token.children // first child
token.children[token.children.length] // last child
token.children[i] // i-th child
Getting an Array of Objects
You can get an Array of all child tokens with the following code.
Array childTokens = token.children.toArray();
|Token byID( int id , Variant processFlow = NULL )
|The unique id number of the token.
|If no process flow is defined, this will search through every ProcessFlow object in the model. When there are multiple process flow objects you can pass in the process flow object (or name) where the token resides for a faster search.
Gets the token associated with the id.Token's have their own unique id among all instances of all ProcessFlow objects.
Token token = Token.byID(25);
Token token = Token.byID(4, "ProcessFlow1");
|release( Variant connector )
|If this is a number or a string, it identifies the connector to be released to. If it is an object, it directly references the new activity to "jump" to.
Releases the token from its current activity.
|setColor( int red , int green , int blue , int alpha )
|The red color component [0 - 255].
|The green color component [0 - 255].
|The blue color component [0 - 255].
|The alpha color component [0 - 255].
Deprecated. Use the color property. Sets the color of the token.This overrides the Token Colors functionality defined in the visual properties of the process flow object.
token.setColor(255, 0, 0);
Adds a stop to the tokenUsually, this method is called when the token is blocked in an activity, such as a Delay. In this case, the token will not leave the activity. The following table describes the effect of stopping the token in various activities, if the token was not previously stopped:
|Effect of stop()
|The token's exit time is postponed.
|Push To List
|The token's Push Value is removed from the list.
|Pull From List
|The token's back order is removed from the list.
|The token's request to enter the zone is destroyed.
|The token's request to acquire the resource is destroyed.
|The token is remove from its batch. If it was the only token in the batch, the batch is destroyed.
|Wait for Event
|The token's listener for the specified event is destroyed.
|The token is removed from its wave. If it was the only token in the wave, the wave is destroyed.
|The task sequence created by this activity is preempted. This is true for all Task Sequence activities.
|static Token create( treenode ownerNode , Variant activity , int start = 0 , Token parent = NULL , int labelAcess = 1 )
|The owner object of the process flow. For a General Process Flow this is the process flow object. For a Fixed Resource, Task Executer or Sub Flow, this is the attached object.
|This can be the activity node or the name of the activity. If this is the activity node in a General Process Flow, ownerNode may be NULL.
|If start is 1, the token will immediately call the activity's start and begin moving through the process flow. If start is 0, the default, the token will sit in the activity until it is manually released. Calling the release method on the token will fire the activity's finish causing the activity's start to never be called. This may affect how the token responds to the activity it was created in. For example, if a token is created in an Assign Labels activity with a start of 1, the created token will evaluate the Assign Labels as if entering the activity and receive whatever labels are assigned to it. If a token is created in the same Assign Labels with a start of 0 and then later it is released, the token will never evaluate the Assign Labels and no labels will be assigned.
|If another token is specified here, the new token will be created as a child of this one.
|This defines what access the child token has to its parent's labels.
The possible access types are:
Creates a token and places it inside the activity for the given owner object (instance).
Token aToken = Token.create(NULL, getactivity("ProcessFlow", "Start"), 0); //General Process Flow
Token newToken = Token.create(Model.find("Processor1"), "Start", 0, aToken, TOKEN_LABEL_ACCESS_READ);
newToken.Type = 1;