This topic applies only to the IBM Business Automation Workflow Advanced
configuration.

Example: Using conditions in XPath expressions

Draft comment:
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15
Draft comment:
This topic was viewed 6 times since its publication
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:
Purchase order business object
Follow these steps to build the XPath expression:
  1. In the XPath Expression Builder, click Insert Simple XPath.
  2. In the Simple XPath Expression Builder, navigate to the orderAge field.
    Simple XPath Expression Builder
  3. Notice that the XPath expression is reflected in the Expression field:
    Expression 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.
    List of available operators.
  6. Select the greater than operator (>).
  7. In the Value field, type 14.
  8. Press Enter to complete the expression.
    Completed expression in XPath builder
  9. ClickOK to return to the main builder page. Your completed XPath expression is shown.
    XPath Expression Builder showing completed expression.
  10. Click OK.