Loop
Description
This Action is used to execute a specific part of the Flow in a loop. The Action should be placed at the beginning of the part of the Flow that will be executed in a loop and is entered at the Start
input, and at the end of that part of the Flow it should be returned to this Action, but now through the Next
input.
Each time the Flow passes through this Action, the value of the set variable will change from the From
to the To
value with the Step
value.
Flow execution will go through (From - To + 1) / Math.abs(step)
times before the iteration completes, and passes through the Done
output.
If we want to stop the iteration before the To
value is reached, then we simply don’t need to return to the Next
input. Also, it is possible to use SetVariable to change the variable by which it is iterated, and thus skip one or more steps.
Properties
Specific
-
Variable
ASSIGNABLE EXPRESSION (integer)
-
A variable that determines the number of passes through the loop and whose value will be changed and tested to see if a new iteration is needed.
-
From
EXPRESSION (integer)
-
The initial value of the variable.
-
To
EXPRESSION (integer)
-
The final value of the variable.
-
Step
EXPRESSION (integer)
-
The value by which the variable is changed on each pass. It can be a positive or negative number.
General
-
Description
String
-
This is the description of the Action component. Description is displayed below the component in the Project editor/viewer. In the main toolbar, it is possible to hide or display descriptions of all components with one click.
Flow
-
Inputs
Array
-
Additional component inputs that the user can add as desired in order to use them to receive additional data needed when evaluating expressions in properties. Each input is given a name and type. Name is used when referencing an input within an expression. A type is used to project Check to check whether a data line that transmits data of that type is connected to the input or not.
-
Outputs
Array
-
Additional component outputs that the user can add to send data through. Each output is assigned a name and type. An example of using this output is e.g. in the Loop component, where we can put the output name for the
Variable
property instead of e.g. variable name. In that case, the Loop component will not change the content of the variable in each step, but will send the current value through that output. -
Catch error
Boolean
-
If this checkbox is enabled then an
@Error
output will be added to the component and if an error occurs in this component during the execution of the Flow, the Flow will continue through that output. The data that will be passed through that output is the textual description of the error.
Position and size
-
Align and distribute
Any
-
Alignment icons and component distribution. Alignment icons appear when two or more components are selected, and distribution icons appear when three or more components are selected.
Inputs
-
start
SEQ | MANDATORY
-
When this input is passed, the variable is set to the
From
value and Flow execution continues throughseqout
. -
next
SEQ | MANDATORY
-
When this input is passed, the variable is changed by the
Step
value. It is tested whether it is less than or equal toTo
value ifStep
is positive, or whether it is greater than or equal to ifStep
is negative.If the variable has not exceeded the
To
value, then Flow execution continues throughseqout
, otherwise it continues throughDone
output.
Outputs
-
seqout
SEQ | MANDATORY
-
Flow execution continues through this output for the duration of the iteration.
-
done
SEQ | OPTIONAL
-
Flow execution continues through this output when the iteration is complete.
Examples
- Loop