Skip to content

Splits as Iterators

The split task can be used to create a "while" or "for every" construct.

This accomplished to setting the split's behavior to "Iterate List" or "Iterate Directory".

When this done, the split does not create a parallel path for each outgoing edge. Instead, it executes the best outgoing edge (usually one one is configured) for each item in a list of items.

workflow-diagram15.png

For example, suppose you have a list of computers and you want to execute a command on each of them. Let's also assume that this list is stored in a variable "computers". You would create a workflow like the one above with a split and join encapsulating a remote command task.

workflow-diagram14.png

When configuring the split, set the behavior to "Iterate List. Set the "List expression" to ${computers} and the "Iterator Variable" to "computer".

Note that the "List Expression" is a velocity expression while the "Iterator Variable" is simply the name of a variable

workflow-diagram16.png

The remote execution task is now configured to use ${computer} as the asset to execute.

At runtime, the split task will execute Task-3 for each member of computers, setting the computer variable to the particular computer being iterated.

Workload Automation and Orchestration