Time for action – the <forEach> loop
Let us now implement the same scenario using the <forEach>
loop:
We don't want to overwrite the
<while>
loop example; therefore, we will add another BPEL process component to the composite diagram. We will call itBookOrderForEachBPEL
:We will also wire it with
BookWarehousingBPEL
:We will use exactly the same schema as in the previous example. To implement the BPEL process, we will first add the
<forEach>
activity to the process flow by dragging-and-dropping For Each from the Components palette (you will find it under Structured Activities):We will double-click the
ForEach1
activity and set Name asManageOrders
and name of the counter variable (Counter name) asOrderCounter
:In the Counter Values tab, we will set the start and the end value for the counter. The start value is
1
and the end value is thecount($inputVariable.payload/ns1:BookData)
expression. With this expression, we will count the number of books in the array. This...