Assume that you want a BPEL process to copy itinerary data from itineraries of customers with no more than two in their party. The input records include a variable that specifies the number of passengers in the customer's party. Do the following tasks:
In the left pane of the BPEL Mapper window, right-click the repeating node that is marked with an asterisk (*) and choose New Predicate.
The Predicate Editor window appears.
Add the Less XPath function to the middle pane.
Add the number literal XPath function to the middle pane. Set the value to 3.
Map the variable node to the first argument of the Less XPath function.
Map the result of the number literal XPath function to the second argument of the Less XPath function.
Map the result of the Less Than XPath function to the Result node in the right pane.
Click OK.
The following example shows how the mapping appears in the Predicate window. Once you click OK, you can use the predicate node in a copy assignment.
If the BPEL process received the following XML, then the predicate would select the first Air tag.
<Air> <NumberInParty>2</NumberInParty> </Air> <Air> <NumberInParty>4</NumberInParty> </Air> <Air> <NumberInParty>6</NumberInParty> </Air> |