SBM Orchestration Guide → Orchestration Procedures → Using the Step Palette → Using the ForEach Step
The ForEach step repeats the operations that you specify for each element in a list or multi-item data element. These operations continue to execute until the last element has been processed. Then the orchestration workflow continues to the next step. The ForEach index counts the number of loops, and the ForEach item is the value of the data element at the end of a particular loop.
When you select a ForEach step, the General and Options tabs appear in the Property Editor. The General tab provides a name and optional description for the step. The Options tab defines the source for the multi-item data element.
Procedure Summary
Select an orchestration workflow to display it in the orchestration workflow editor.
On the Data Mapping tab of the Property Editor, create an array of working data. (See Creating Arrays of Working Data.)
In the New Items section of the Step Palette, drag and drop a ForEach step onto the line between the Start and End steps.
The lines from the ForEach step icon travel in two directions. One points to subsequent steps and the other loops back to the ForEach step icon. You place the steps or calculations that are to be repeated on the loop that points to the ForEach step icon.
On the General tab of the Property Editor, you can change the name of the ForEach step and you can also enter a description.
On the Options tab, in the Source section, enter an expression that describes the source of the data to be processed. You can use any of the functions, logical operators, or arithmetic operators available on the Functions, Logical, and Operator menus, respectively.
For more information about expressions, see About the Expression Editor.
Add other steps from the Step Palette to the repeating section (the top loop) to define the actions that should be taken or calculations that should be performed while there are still members of the data element to be processed.
Add other steps from the Step Palette to the non-repeating section (the bottom loop) to define the actions that should be taken or calculations that should be performed after all of the members of the data element have been processed.
Copyright © 2007–2017 Serena Software, Inc. All rights reserved.