A class representing a sequence of tasks to be performed by a TaskExecuter.
See Task Sequence Concepts for more information on task sequences.
currentTask | Accesses the first task in the task sequence that has not yet finished execution. This task may be currently executing, or it may be waiting for execution because the task sequence itself is waiting for execution. |
labelProperties | Use your own named properties to get/set label values. |
preempt | Gets/sets the preempt value of the task sequence. |
priority | Gets/sets the priority value of the task sequence. |
rank | Gets/sets the rank of the task sequence in its task sequence queue. |
tasks | Accesses the set of tasks in the task sequence. This member can be used like an array of TaskSequence.Tasks. |
addTask | Adds a new task to the task sequence. |
dispatch | Dispatches the task sequence. |
move | Moves the task sequence into a new dispatcher's task sequence queue. |
create | Creates a new task sequence. |
readonly TaskSequence.Task currentTask
Accesses the first task in the task sequence that has not yet finished execution. This task may be currently executing, or it may be waiting for execution because the task sequence itself is waiting for execution.
TaskExecuter op = Model.find("Operator1");
TaskSequence ts = op.taskSequences[1];
int curTaskType = ts.currentTask.type;
...
Variant labelProperties
Use your own named properties to get/set label values.
The TaskSequence class allows you to get and set custom named properties that will apply to labels on the task sequence. For example, if you want to set a label named "MyLabel" on the task sequence ts to a value of 5, you can write the following code:
ts.MyLabel = 5;
This will set the label's value to 5. If a label of that name does not exist, then it will be added to the object's labels.
If you want to return the value stored in ts's "MyLabel" label, you can execute the following code:
return ts.MyLabel;
This works the same as the treenode class's dynamic property mechanism. See treenode.labelProperties for more information
int preempt
Gets/sets the preempt value of the task sequence.
TaskExecuter op = Model.find("Operator1");
TaskSequence ts = op.taskSequences[1];
int preempt = ts.preempt;
...
double priority
Gets/sets the priority value of the task sequence.
TaskExecuter op = Model.find("Operator1");
TaskSequence ts = op.taskSequences[1];
double priority = ts.priority;
...
int rank
Gets/sets the rank of the task sequence in its task sequence queue.
TaskExecuter op = Model.find("Operator1");
TaskSequence ts = op.taskSequences[1];
int tsRank = ts.rank; // should be 1
...
Accesses the set of tasks in the task sequence. This member can be used like an array of TaskSequence.Tasks.
TaskExecuter op = Model.find("Operator1");
TaskSequence ts = op.taskSequences[1];
int numTasks = ts.tasks.length;
for (int i = 1; i <= numTasks; i++) {
Task task = ts.tasks[i];
}
TaskSequence.Task addTask( int type , treenode involved1 = null , treenode involved2 = null , Variant var1 = nullvar , Variant var2 = nullvar , Variant var3 = nullvar , Variant var4 = nullvar ) |
involved1 | The first involved object of the task. The meaning of this is dependent on the task type. See Task Type Quick Reference for more information. |
involved2 | The second involved object of the task. The meaning of this is dependent on the task type. See Task Type Quick Reference for more information. |
var1 | The first variable of the task. The meaning of this is dependent on the task type. See Task Type Quick Reference for more information. |
var2 | The second variable of the task. The meaning of this is dependent on the task type. See Task Type Quick Reference for more information. |
var3 | The third variable of the task. The meaning of this is dependent on the task type. See Task Type Quick Reference for more information. |
var4 | The fourth variable of the task. The meaning of this is dependent on the task type. See Task Type Quick Reference for more information. |
TaskSequence.Task | The added task. |
Adds a new task to the task sequence.
TaskSequence ts = TaskSequence.create(Model.find("Operator1"));
ts.addTask(TASKTYPE_LOAD, item, current);
...
ts.dispatch();
void dispatch( ) |
Dispatches the task sequence.
Calling this method initiates Dispatcher logic for receiving the task sequence and dispatching it as needed. If the object on whom the task sequence was created is a TaskExecuter and the TaskExecuter is not already executing another task sequence, then the object will immediately begin execution of the task sequence.
TaskSequence ts = TaskSequence.create(Model.find("Operator1"));
ts.addTask(TASKTYPE_LOAD, item, current);
...
ts.dispatch();
void move( Dispatcher dispatcher ) |
dispatcher | The dispatcher to move the task sequence to. |
Moves the task sequence into a new dispatcher's task sequence queue.
static TaskSequence create( treenode obj , double priority = 0 , int preempt = 0 ) |
obj | Specifies the object in which to create the task sequence. Generally this should be a Dispatcher or TaskExecuter. In such a case, the task sequence will be created in the task sequence queue of the object. If the object is not a Dispatcher or TaskExecuter, then the task sequence will be created as a subnode of that object/node. |
priority | Optional. Defines the priority value of the task sequence. |
msgparam1 | Optional. Defines the preempt value of the task sequence. If not zero, it should be one of the following values: PREEMPT_ONLY, PREEMPT_AND_ABORT_ACTIVE, or PREEMPT_AND_ABORT_ALL. |
TaskSequence | The created task sequence. |
Creates a new task sequence.
TaskSequence ts = TaskSequence.create(Model.find("Operator1"));
ts.addTask(TASKTYPE_LOAD, item, current);
...
ts.dispatch();