Developer Guide to the BPEL Designer

Predicate Scenario

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:

  1. 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.

  2. Add the Less Than XPath function to the middle pane.

  3. Add the number literal XPath function to the middle pane. Set the value to 3.

  4. Map the variable node to the first argument of the Less Than XPath function.

  5. Map the result of the number literal XPath function to the second argument of the Less Than XPath function.

  6. Map the result of the Less Than XPath function to the Result node in the right pane.

  7. 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.

Screen capture of mapping for predicate

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>