Skip to content

Foreach

Johannes Heucher edited this page Oct 12, 2022 · 4 revisions

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.

Table of Contents

Modeling a Foreach Operator

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.

Output Parameters of an Iterated Process Step

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.

Nested Foreach Operators

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.

See Also

Clone this wiki locally