Workflow: Scheduling Constraints and Preconditions
Scheduling constraints specify the order in which tasks are enacted. A scheduling constraint is graphically represented as an arrow connecting two tasks. It indicates that the task at the head of the arrow cannot start until the task at the tail of the arrow (the antecedent task) has completed.
A task can have several antecedent tasks. In order for a task to be considered for enactment, all its scheduling constraints must be met – that is, all antecedent tasks have to be either completed or discarded.
Once the scheduling constraints have been met, the engine then determines whether the task should be activated or whether it should be discarded. If at least one of the antecedent tasks was completed, then the task can be activated (though some task properties, such as a state trigger or precondition, might prevent it from running). However, if all the antecedent tasks were discarded, then the task is discarded.
Preconditions
Preconditions: Creating a task that runs only if certain conditions are met
A precondition is an expression that has to be met before the task can be executed. A task’s precondition is checked at the point where a task is being considered for enactment, that is, when its scheduling constraints are met. If at that point the precondition is true, the task becomes active. Otherwise, it is discarded, and is not activated again even if its precondition subsequently becomes true.
Example: The Check pregnancy history enquiry should only be executed if the patient is a woman, that is, if the expression patient_gender = female is true. If it is false then the Check pregnancy history enquiry is discarded.
Combining scheduling constraints and preconditions enhances the workflow flexibility.
Browse through a process-description sample:
- Cold And Flu Guide
- A simple workflow process where, based on a decision, one of several branches is chosen. Preconditions control branch selection.
- If you have installed the Tallis Toolset, you can find this sample in the World > Samples folder in the ACL Web Repository.
- Run this sample file
- Click here for a detailed description of this sample.
Workflow Patterns
Note: If you have installed the Tallis Toolset, you can find the following samples in the World > FlowPatterns folder in the ACL Web Repository.
Sequence
A task in the process is activated after the completion of an antecedent task in the process.
Parallel Split
A point where a single process thread splits into multiple process threads, thus allowing tasks to be executed simultaneously or in any order.
Synchronization
A point where multiple parallel process threads converge into one single thread, thus synchronizing multiple tasks.
Synchronizing Merge
A point where multiple parallel process threads converge into one single thread. If more than one path is taken, synchronization of the active tasks takes place. If only one path is taken, the alternative branches are discarded (preconditions determine whether branches are discarded).
Note: Enquiry2 is activated if the patient is older than 40.
Note: Action1 is activated if candidate1 is selected; action2 is activated if candidate2 is selected.
Exclusive Choice
A point where, based on a decision or workflow data, one of several branches is chosen (preconditions control branch selection).
Note: Action1 is activated if the patient is over 40; action2 is activated if the patient is under 40.
Note: Action1 is activated if candidate1 is selected; action2 is activated if the candidate2 is selected.
Multi Choice
A point where, based on a decision or workflow data, a number of branches are chosen (preconditions control branch selection).
Note: Action1 is activated if the patient is over 30; action2 is activated if the patient is under 50.
Note: Action1 is activated if candidate1 is selected; action2 is activated if the candidate2 is selected.
The workflow patterns above are based on patterns found at www.workflowpatterns.com. If you have installed the Tallis Toolset, you can find the above samples in the World > FlowPatterns folder in the ACL Web Repository.
Creating a Scheduling Constraint
Place the cursor above the first task. Two yellow squares appear on the task.
Click on one of the squares, and drag over the second task. Two yellow squares appear on the task – release the mouse key above one of them.
An arrow is formed between the two tasks. The second task executes only after the first task is completed. If the antecedent task is discarded, the second task is discarded as well.
Note: If a task has several antecedent tasks, it only executes after all of them have been executed and if at least one of them has completed.