Loop Activities
In addition to a starting and an end point, loop activities offer a loop exit and a loop entry for the loop transitions. Transitions from a loop exit to an activity entry have the property 'FROM LOOP', whereas transitions from an activity exit to a loop entry have the property 'TO LOOP'.
Schema:
A loop passes data through the loop exit to a 'FROM LOOP activity' and receives it back from a 'TO LOOP activity'. If the data meets the exit condition, the loop passes them through the end point to the 'next activity'.
You can specify the type and a condition for a loop and configure the variable transfer for local loop variables.
Loop Type
You can specify the loop type in the properties dialog of the loop activity:
A 'Repeat/Until' loop passes data at least once through the loop exit to the 'FROM LOOP activity'. It then checks the data that it receives via the loop entry from the 'TO LOOP activity'. If the condition is true, the data is passed through the end point to the 'next activity'. If the condition is false, the data is passed to the 'FROM LOOP activity' and the loop activity is terminated.
'While' loops review data before it is forwarded. If the condition is true, the data is passed through the loop exit to the 'FROM LOOP activity'. It then re-checks the data that it receives from the 'TO LOOP activity'.
If the condition is false, the data is forwarded via the end point to the 'next activity' and the loop is terminated.
Condition
You can specify the loop condition in the properties dialog of a loop activity:
A 'While' loop keeps the data within the loop as long as the expression is true.
A 'Repeat/Until' loop keeps the data in the loop until the expression is true.
You can also specify script code. The script will be executed before the loop condition is checked. Via the script you can access and change the current variable values. Changes are only taken into account for checking the conditional term, not returned to the process.
Local Loop Variables
In addition to variable transfer, loop variables must be defined for a loop activity.
In the same way you would set up variable transfer, enter the default activity and optional assignments.
Then open the Input and output parameters of the loop dialog by pressing the Loop variables button:
Select an activity and activity variables and click the Add button to configure the Input parameters and Output parameters.
Input parameters consist of the data forwarded to the activity through the 'FROM LOOP' transition, where the data is modified before it is transferred again to the loop activity to be checked. Usually, the input parameters of the 'FROM LOOP activity' are variable values assigned to the loop activity.
Output parameters are data that is passed to the loop activity through the 'TO LOOP' transition to be checked.