Time for action – adding the <while> loop
Let us start with the <while>
loop:
Before adding the
<while>
loop, construct the BPEL flow. We will add two variables:NoOrders
andi
, both of the typexsd:int
. We can add variables using the big green plus sign in the lower left window:Alternatively, we can write source code directly:
Then we will need to know how many items we have in our list of book orders. We will use the XPath
count()
function to achieve this. Alternatively, we could use an Oracle extension functionora:countNodes()
, but this would make our code vendor specific. At the same time, we will initialize the counter variablei
. We will add an<assign>
activity to the process flow and make both<copy>
expressions. You can use the Edit Assign dialog windows (as we've shown in Chapter 3, Variables, Data Manipulation, and Expressions) or enter the source code directly:Now we are ready to add the
<while>
loop construct to the BPEL flow. You should drag...