Double-click the ForEach activity. In the Counter Name field of the General tab, enter a counter value name, as

9-20 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 9–15 Completion Tab of the forEach Activity

9. Click Apply, then OK.

10. Expand the contained Scope activity of the ForEach activity.

11. Design the enclosed Scope activity.

When complete, the forEach and contained scope activity can appear similar in structure to that shown in Figure 9–16 . Figure 9–16 forEach Activity with Contained and Expanded Scope Activity

9.3.2.2 What Happens When You Create a forEach Activity

Example 9–12 shows the .bpel file after design is complete for a sequential forEach activity. Using Parallel Flow in a BPEL Process 9-21 Example 9–12 forEach Activity - Sequential faultHandlers catch faultName=bpel:invalidBranchCondition sequence assign copy frominvalidBranchCondition happenedfrom tooutput.payloadto copy assign reply name=replyOutput partnerLink=client portType=tns:Test operation=process variable=output sequence catch faultHandlers sequence -- pick input from requestor -- receive name=receive createInstance=yes partnerLink=client portType=tns:Test operation=process variable=input assign copy from3from torequest.payloadto copy copy fromfrom tooutput.payloadto copy assign forEach counterName=i parallel=no startCounterValueinput.payloadtns:startCounter+1startCounterValue finalCounterValueinput.payloadtns:finalCounter+1finalCounterValue completionCondition branchesinput.payloadtns:branches+1branches completionCondition scope name=scope1 partnerLinks partnerLink name=DummyService partnerLinkType=tns:DummyService myRole=DummyServiceClient partnerRole=DummyServiceProvider partnerLinks sequence assign copy fromconcatoutput.payload, i, Afrom tooutput.payloadto copy assign invoke name=invokeDummyService partnerLink=DummyService portType=tns:DummyPortType operation=initiate inputVariable=request receive name=receiveFromDummyService partnerLink=DummyService portType=tns:DummyCallbackPortType operation=onResult variable=response assign copy fromconcatoutput.payload, i, Bfrom tooutput.payloadto