Markers show that activities have additional execution parameters. There are several types of activity markers in ELMA BPM:
You can use markers for the following operations:
The list of the available markers depends on the activity type:
Click the Change Marker button to select one of the available markers; a new corresponding tab will appear in the activity settings window.
|
Fig. 1. The Change Marker button and the marker selecting window.
|
Conditional Operation
When you select this marker, the Execution Condition tab appears in the settings window.
Execution Condition tab
A condition for executing an activity can be set as a table with one or several conditions (fig. 2) or as a script (fig. 3).
Setting a Condition as a Table
You can sequentially add one or several conditions in a table and specify the comparison operator. The conditions will be checked and if the result is "True", the activity will be started; otherwise, ELMA skips the activity and the process continues using the default sequence flow.
In each condition, a context variable is compared with another context variable or with the specified values.
|
Fig. 2. The Execution Condition tab. Table.
|
- Add a condition. - Delete a condition.
A Link is an operation used to calculate the result of the condition check:
-
AND - The output is "true" when both inputs are "true";
-
OR - The output is "true" if either or both of the inputs are "true";
-
NAND - The output is "true" if at least one of the inputs is "false";
-
NOR - The output is "true" if both inputs are "false".
You can specify a link if you enter more then one condition.
Attention!
In the table the AND, NAND links have priority over the OR, NOR links. For example, Condition1 OR Condition2 AND Conditions3 NOR Condition4 NAND Condition5 = Condition1 OR (Condition2 And Condition3) NOR (Condition4 NAND Condition5).
|
-
Operand 1 - A process context variable.
-
Operation - A comparison operation.
-
Operand 2 - A process context variable or a specified value to compare with the Operand 1.
To select operands, operations and a link, click the respective links in the table.
Setting a Condition as a Script
Select a script in the drop-down list. A script is a function written in C#. You can either select an existing script from the drop-down list or create a new one by clicking the cross icon . The script must return the Boolean value (data type C# bool, “true” or “false” values).
If you click the Go to button you will be redirected to the script page on the Script tab. This tab provides tools for writing scripts in C#, for example, syntax highlighting, code completion (IntelliSense technology), links to assemblies and web services.
|
Fig. 3. The Execution Condition tab. Script.
|
When you select this marker, the Loop Execution Condition tab appears in the settings window.
Loop Execution Condition
In the Do-While Check Time specify whether the condition is checked before or after the operation. Suppose the condition is not true when the process flow reaches the operation. The system will still perform it, if you specify to check the condition after the operation. If the condition is checked before the operation and it is not true, the system will not execute it.
You can specify conditions as a table or as a script, in the same manner as described earlier in the Conditional Operation section.
The operation will loop while certain condition is true. If the condition is not true, the process continues.
|
Fig. 4. The Loop Execution Condition tab.
|
Multiple Execution
You can use this marker if you need to simultaneously start multiple instances of a sub-process. The system executes these instances independently of the parent process while still executing the parent process in accordance with the model.
In most cases, the Multiple Execution marker is used when a user needs to start a sub-process instance and still be able to work without suspending the parent process.
When you select this marker, the Multiple Execution tab appears in the settings window.
Multiple Execution Tab
On this tab, specify the required number of the sub-process instances. You can specify an exact value (fig. 5) or a context variable that will store the number of the sub-process instances (fig. 6).
|
Fig. 5. The Multiple Execution tab. The exact number of the sub processes.
|
A context variable is an integer type variable. The variable value must be defined by a script or by a user, before the process reaches this activity.
The Add Variable button allows you to create a context variable of the integer type that will store the number of the sub-process instances.
|
Fig. 6. The Multiple Execution tab. Specifying a context variable that will store the number of sub-process instances.
|
Example
Usually you need to start multiple external sub-processes with different context variable values. The example will graphically represent a situation where the same task will be assigned to multiple users. For this, define the initiator, executors and their number. As different users can initiate a process, a dynamic swimlane is used to represent them in the graphic model (fig. 7); a script will define the number of executors. Each new sub-process will be started in turns for each executor.
|
Fig. 7. The Multiple Execution tab. Configuring the dynamic swimlane settings in the parent process.
|
As a result, you get the following context variables of the parent process necessary to start multiple sub-processes:
-
List of Executors – A Block type variable that contains an Executor property of the User type;
-
Number of Executors – An Integer type variable;
-
Initiator – A User type variable;
-
Task Executor – A User type variable.
Along with necessary variables, we define additional variables used in the sub-process:
-
Task Name - A String type variable;
-
Task Description - A Text type variable.
According to the process logic, the Initiator must enter the name and the text of the task and make a list of executors. Therefore, in the swimlane that represents the Initiator place the task Assign the task and select executors. Configure the task form so that it displays fields for the specified context variables (fig. 8).
|
Fig. 8. Multiple Execution marker. Configuring the task “Assign the task and select executors”.
|
After the Initiator has filled in the required fields (the task name, task text and executors list), the system must calculate the number of executors in the list. To count the list items, a Scrip activity is used:
context.NumberOfExecutors = context.ListOfExecutors.Count;
An XOR Gateway is used to split the flow in two outgoing paths:
-
If the number of executors = 0, then the process moves down the default outgoing connector towards the End Event;
-
If the number of executors > 0, then the process moves towards the script Select the executor and start the sub-process (fig.9).
|
Fig. 9. Multiple Execution marker. Configuring the connector towards the multiple sub-processes.
|
Now it is necessary to write a script that describes the selection of the executor and starts the sub-process. In the script, the value of the last list item must be assigned to the Task Executor variable; the number of list items (stored in the Number of Executors variable) must be decremented by 1:
сontext.NumberOfExecutors = context. NumberOfExecutors - 1;
context.TaskExecutor = context.ListOfExecutors.ToArray()[(int)context.NumberOfExecutors].Executor;
Please note that the counter will be first reduced by one, and only then its value can be used as an array element number. It is done because array elements in C# are numbered from 0, so the first element in an array has the index 0, while the last element has an index equal to one less than the number of items in the array.
Now it is time to pass the configured context variables in the external sub-process. To do this, place the External sub-process activity in the graphic model and select the required sub-process from the list of processes. The context of this sub-process must contain the following variables:
-
Initiator – A User type variable;
-
Task Executor – A User type variable;
-
Task Name – A String type variable;
-
Task Description - A Text type variable.
These variables must be marked as input values (fig. 10).
|
Fig. 10. Multiple Execution marker. Configuring the sub-processes context.
|
Configure the input variables for the External Sub-Process activity with the Multiple Execution Marker (fig. 11). In the example, the activity name is Multi-Instance Subprocess.
<>
|
Fig. 11. Multiple Execution marker. Configuring the Multi-Instance Subprocess settings .
|
After the sub-process is started, the parent process must return to the XOR gateway to check the number of executors in the list. Here is the parent process model (fig. 12) .
|
Fig. 12. Multiple Execution marker. The graphic model of the parent process.
|
Copyright © 2006–2019 ELMA