-
Notifications
You must be signed in to change notification settings - Fork 0
Foreach
Figure 1 To successively access single list elements of a certain Parameter inside of a Workflow, the Foreach operator iterates a list.
The Foreach operator is displayed as a universal qualifier (∀) above the Process Step, that will be iterated.
To model a Foreach operator, you have to model a Process Step with a single-valued Input Parameter . Passing a list-valued Parameter
of matching Data Type to that Process Step, the Process Step is automatically wrapped into a Foreach operator.
Please note: The existance of the Foreach operator is a direct consequence of the data flow from a list-valued Parameter to a single-valued Parameter. There is no way to model a Foreach operator explicitly.
Figure 2: Foreach with Output Parameter ''Device Id'' and a Service taking a ''Device Id'' list
Each Output Parameter of the Process Step, wrapped into the Foreach, is automatically considered as list-valued Parameter and can be used in the further Process Steps of the Workflow (fig. 2). If the Process Step output was a list to begin with, all output lists get merged. Null values are considered empty lists.
If you have more than one single-valued Input Parameter and pass a matching list to each, you get a Foreach operator for each passed list. So the Process Step is executed for each possible combination of Input Parameters.