Developer Guide to BPEL Designer: The BPEL Mapper

Last Updated: 23 October 2006
Contributed and maintained by Wallis Sholar

Contents

Developer Guide to BPEL Designer


About the BPEL Mapper

The BPEL Mapper provides a framework for processing and directing BPEL process data. This framework consists of the following components:

top


Creating BPEL Mappings

You can create a mapping from the source tree pane directly to the destination tree pane, without using any of the functions. This type of mapping can be any of the following:

You can also create a mapping that uses one or more XPath functions from the BPEL Mapper's menu bar. For example, if the BPEL process includes a Wait activity that waits for a period of time, then you can use the Duration Literal function to specify the duration.

To create a mapping without using any functions:

  1. In the source tree pane, expand the tree component until the node that you want to map from appears.
  2. If the destination tree pane contains a tree component, then expand the tree component until the node that you want to map to appears.
  3. Select the node in the source tree pane and drag the pointer to the node in the destination tree pane.
    A link connects the nodes.

To use a function in a mapping:

  1. Click the drop-down menu that contains the function.
  2. Click the function.
    A function box appears in the middle pane.
  3. Map any arguments into the appropriate connector on the left side of the function box. The source can be a node in the source tree pane or the output from another function box. If an argument is optional, then a question mark appears after the argument name.
  4. Map the result from the right side of the function box. The destination can be a node in the destination tree pane or the input into another function box.

To delete a link or function in a mapping:

  1. Select the link or function.
  2. Press Delete.

top


Working with Predicates

The BPEL Mapper enables you to create a predicate that consists of XPath functions.

A predicate applies a condition to a node that can have multiple values. The result is the subset of nodes that satisfy the condition.

For example, assume that a node represents the amount of a product. If you want to select all products whose amount is greater than 50, then you can use the greater than and number literal functions to define the condition.

Only certain types of nodes allow you to create predicates. The contextual menu of these nodes contains the New Predicate option.

Once you create a predicate, you can use the predicate in an assignment. For example, you can copy data from a predicate in the source tree pane to a node in the destination tree pane.

You can edit or delete an existing predicate.

To create a predicate:

  1. In the source tree pane, right-click a node and choose New Predicate.
    The Predicate Editor appears.
  2. Use XPath functions to create the condition for the predicate. Map the result to the predicate node in the destination tree pane.
  3. Click OK.
    The editor adds the predicate node immediately below the original node. The condition appears in brackets.

To edit a predicate:

  1. In the source tree pane, right-click the predicate node and choose Edit Predicate.
  2. Modify the condition.
  3. Click OK.

To delete a predicate:

  1. In the source tree pane, right-click the predicate node and choose Delete Predicate.
  2. Click Yes.

top


XPath Function Reference

A collection of XPath functions are available in the BPEL Mapper's menu bar. These functions are based on the XPath 1.0 specification.

Each function has zero or more arguments. Each function returns a single result.

The menu bar contains the following drop-down menus: Datetime, Operator, Boolean, String, Nodes, and Number.

Datetime

The Datetime menu contains the following functions:

Operator

The Operator menu contains the following functions:

Boolean

The Boolean menu contains the following functions:

String

The String menu contains the following functions:

Nodes

The Nodes menu contains the following functions:

Number

The Number menu contains the following functions:

top


Mapping Examples

These examples illustrate a variety of mapping scenarios:


Assign Activity Scenario

Assume that you want a BPEL process to copy data received from a partner. Do the following tasks:

  1. Add an Assign activity after the Receive activity.
  2. Select the Assign activity and use the editor to define one or more copy assignments.

The following example shows a copy assignment that does not use any XPath functions. The itinerary part of the ItineraryIn variable is copied to the itinerary part of the ItineraryOut variable. Notice that the left pane and the right pane contain the same tree component.

Screen capture of mapping for Assign activity with direct mapping
Click to enlarge

The following example shows a copy assignment that uses the concat XPath function. The input variable paramA is concatenated to the end of the string literal Parameter A: and copied to the output variable paramA.

Screen capture of mapping for Assign activity with concat XPath function
Click to enlarge

If Activity Scenario

Assume that you want to execute a series of steps only if a certain condition is true. Do the following tasks:

  1. Add an If activity to the BPEL process.
  2. Select the If activity and use the editor to define the Boolean condition.
  3. Add the steps inside the If activity.

The following example shows a mapping for the condition. The mapping uses the Not XPath function, which is available from the Boolean portion of the menu bar. If the itinerary has an airline reservation, then the Not XPath function returns true. The result is mapped to the Result node in the right pane.

Screen capture of mapping for If activity
Click to enlarge

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 editor, right-click the repeating node and choose New Predicate.
    The Predicate 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
Click to enlarge

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>

top


Copyright and Trademark Notice