Use the For Each element to repeatedly execute its contained scope activity exactly N+1 times where N equals the Final Counter Value minus the Start Counter Value.
In the Design view, drag the For Each element from the Palette to the diagram.
Add elements that will be repeatedly executed from the Palette into the For Each element. The elements that you add are automatically wrapped into the Scope element.
Right-click the For Each element and choose Properties to open its Properties window.
The Properties window for the For Each element includes the following properties:
Name: Specifies the name of the For Each element.
Counter Variable Name: Declares the counter variable name.
Start Counter Value: Sets the start counter value. Use the BPEL Mapper to generate an integer value expression.
Final Counter Value: Sets the final counter value. Use the BPEL Mapper to generate an integer value expression.
When the For Each activity is started, the expressions in Start Counter Value and Final Counter Value are evaluated for the first and only time. That is, once the two values are returned they remain constant for the lifespan of the activity. If the Start Counter Value is greater than the Final Counter Value, then no iteration will be performed.
Completion Condition: (Optional) Specifies an integer value expression. After execution of each directly enclosed activity, the number of completed activities is checked against this value. When the number of completed activities equals the value of the specified expression, no further activities are started. When the expression value is greater than the available number of iterations, then no iteration will be started.
Count Completed Branches Only: (Optional) If this checkbox is selected, it tells the runtime to only count the branches that have completed successfully. If this checkbox is cleared, all branches, completed successfully or unsuccessfully, will be counted.
Documentation: User documentation attached to the element. This documentation is included with the source code of the BPEL process and can be extracted and included in a report.