Designing Business Processes in the Sun Business Process Manager

Using Predicates with Repeating Nodes

For web services or components that contain repeating nodes, the Business Rule Designer displays the repeating nodes in the input and output attributes for each activity, designated by the repeating icon. For direct node mapping, repeating nodes are used to dynamically populate 1-n values based on the runtime data.

XPath predicates are only used with repeating nodes and allow you to isolate particular elements in repeating nodes at runtime. Predicates allow you to define conditional mappings in a business rule when using BP attributes that contain repeating values.

The Predicate Editor allows you to define the conditions for the mapping. Once you define the conditions, you can map the associated repeating node values using the Business Rule Designer (at that point, the condition is in effect for that mapping). An indication of the condition appears to the right of the repeating node or element for which the condition was defined. At runtime, the condition is used to select the correct element and perform the mapping as designed.

Creating a New Predicate

You can create a predicate for a repeating node while you are defining business rules in the Business Rule Designer.

ProcedureTo create a new predicate

  1. From the Business Rule Designer, right-click a repeating node.

  2. Click New Predicate.

    The Predicate Editor appears.

  3. In the Predicate Editor, define the conditions for the predicate.

  4. Click OK.

  5. On the Enterprise Designer toolbar, click Save.

Editing a Predicate

Once you create a predicate, you can modify the conditions as needed.

ProcedureTo edit a predicate

  1. From the Business Rule Designer, right-click the existing predicate

  2. Click Edit Predicate.

    The Predicate Editor appears.

  3. In the Predicate Editor, modify the conditions for the predicate.

  4. Click OK.

  5. On the Enterprise Designer toolbar, click Save.

Deleting a Predicate

Once you create a predicate, you can delete the predicate if needed.

ProcedureTo delete a predicate

  1. From the Business Rule Designer, right-click the existing predicate.

  2. Click Delete Predicate.

  3. On the dialog box that appears, click Yes.

    The Predicate condition is removed.

  4. On the Enterprise Designer toolbar, click Save.

Predicate Example

The most common use of predicates is to create a condition using either runtime BP attribute values or fixed values in an expression, and then create an appropriate mapping for when that condition is found to be true.

In certain instances, the names in one BP attribute must match name in the JMS Message User property. When the condition is found to be true, the appropriate mapping for value then takes place. In addition, only the appropriate value for value is mapped from the series of name and value pairs.