IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Building mediation flows > Create XPath expressions

Example: Using conditions in XPath expressions

This example shows how to add a condition to evaluate an expression on a field, using the XPath Expression Builder.

This example illustrates a simple order processing scenario. Each order contains a field for the age of the order, along with customer information. In this example, we want to identify orders that are older than 14 days.

The business object used in this example has the structure show below:

Follow these steps to build the XPath expression:

  1. In the XPath Expression Builder, click the Insert Simple XPath button.

  2. In the Simple XPath Expression Builder, navigate to the orderAge field.

  3. Notice that the Xpath expression is reflected in theExpression field:

  4. Since orderAge is a not a repeating field, we will add a condition. Expand Add an optional condition.

  5. Click the Operator field, and click the arrow to view the list of operators.

  6. Select the greater than operator (>).

  7. In the Value field, type 14.
  8. Press Enter to complete the expression.

  9. Press OK to return to the main builder page. Your completed XPath expression is shown.

  10. Click OK.

Create XPath expressions