You use the Parallel For Each loop option in the process composer to model multiple parallel instances of activities in the process model. Thus, at runtime you can execute a dynamic number of activity instances in parallel. You define the exact number of instances to be executed at runtime with a loop context in the process composer. To define the loop context, you can select a specific data object with an XSD element, which is a list from the process context, or use an expression, which evaluates to a list. The number of elements in the list defines how many instances are executed.
All the instances of an activity are executed in parallel. The process flow continues after this activity when all of its parallel instances have been completed. You can use the Parallel For Each loop option and execute multiple instances of the following activities:
When you use the Parallel For Each loop option, the following additional loop-specific data objects are automatically created:
This data object contains the number of completed loop instances.
This data object contains the list element assigned to each loop instance.
These two data objects are only relevant for loops and are part of the local context of the activity for which you model the multi-instance loop. Thus, you can use the loop-specific data objects when you define input and output data mapping for this activity, but you cannot use the two loop-specific data objects for data mappings of other activities in the process.
You can use the loop-specific data objects only as a source when defining data mappings but not as a target. If it is necessary to transport information from within the loop context to a data object outside the loop context, you define the corresponding output mapping and append, for example, the loop mapping nodes to the existing ones in the data object. For more information about mappings, see Defining Data Mappings .
You have opened the Process Development perspective in the SAP NetWeaver Developer Studio and have expanded your project in Project Explorer view.
You have created an activity of such a type which allows you to use the Parallel For Each loop option.
Expand Process Modeling , then expand Processes .
In the context menu of a process, choose Open .
In the modeling surface, choose an activity.
On the Looping tab page in the Properties view, select the Parallel For Each radio button.
Define the loop context using one of the following options:
Select the Select collection radio button and select a data object from the Collection dropdown menu.
Select the Use expression radio button and choose the Edit... pushbutton to specify an expression in the expression editor which evaluates to a list. For more information about expressions, see Creating Expressions .
Choose the OK pushbutton.
If you use context nodes in your expression from different namespaces with equal names, you have to declare the namespaces of these nodes. To solve the name conflict you can define a name prefix for the namespace. This declaration has the following syntax: xmlns:<prefix_name>="namespace_name" .
You have modeled a multi-instance loop of an activity. A parallel marker appears at the bottom center of the activity flow object in the process model. When the process flow reaches the activity at runtime, as many activity instances as you defined with the loop context are started in parallel.