Article: AN0002041Updated: 17.10.2018
Activity Cycle is used for repeated start of part of workflow. There are two types of cycle available FOR and WHILE. Repeatedly started part of workflow is defined by means of a nested scheme.
Cycle FOR
There is defined initial value, final value and step that is added to the counter after finishing one cycle. This cycle is going on, till one of following conditions is met:
Step > 0 and counter <= To - counter is increased in each cycle by value Step. The cycle is terminated, when the counter is greater than To.
Step < 0 and counter >= To - counter is decreased in each cycle by value Step. The cycle is terminated, when the counter is lesser than From.
Values From, To and Step can be defined directly in the activity Cycle or can be calculated just before the activity start by means of script Initialization condition script. After the cycle activity start it is not possible to change the values.
The value Step cannot equal 0. All the values Step, From, To are integer (int).
Before own first cycle execution it is found out if the above condition is true. If not, the cycle is not started.
Example:
OGWFForCycle.From = 20;
OGWFForCycle.To = 100;
OGWFForCycle.Step = 5;
If you do not enter the values neither in the activity definition nor by means of script, they are all set to a default value 0.
Cycle WHILE
Only script with a condition is defined in this type of cycle. The cycle is going on till the condition in the script is valid.
Before own first cycle execution it is found out if the above condition is true. If not, the cycle is not started.
Example:
var value = 1;
return value < 10;
Activity properties
Name |
Description |
Name |
Name of the activity. It is displayed in the scheme and is used for entry into the workflow log. |
Description |
Description of the activity. It is displayed after moving the mouse over the activity in the scheme. |
From |
Initial value of the counter. |
To |
Final value of the counter |
Step |
Step of the counter |
Initialization condition script |
Script for cycle FOR that is use to calculate values From, To and Step before start of the activity. |
Condition script |
Script for finding out if the cycle WHILE shall continue. |
When configuring the activity it is necessary to enter Name and Description.
You have to enter values From, To and Step when using FOR cycle. However, if you enter Initialization condtion script, these values are not mandatory and it is assumed that they will be defined by means of the script.
You have to enter Condition script for WHILE cycle.
Termination of repeatedly started part of workflow
In order to terminate nested part of workflow activity End can be used. In case of activity Cycle there is apart from standard types of activity End one more type of end: Continue with next cycle round, that terminates one actual cycle course and continues with next cycle course.
Objects in scripts
There are following objects available in scripts:
Cycle type |
Object |
Description |
For + While |
OGWFActualRun |
Special objects for currently executed workflow instance. |
For |
OGWFForCycle |
Object for definition of values in cycle FOR. |