How to Create an If Activity

To create an If activity:

  1. In the Components window, expand BPEL Constructs.
  2. Drag an If activity into the designer.

    The if and else conditions are displayed, as shown in Figure 11-1.

  3. Click the if branch.
  4. In the Condition field, enter a condition, as shown in Figure 11-2. You can also click the XPath Expression Builder icon to invoke the Expression Builder dialog.

    Figure 11-2 if Branch of the If Activity

    Description of Figure 11-2 follows
    Description of "Figure 11-2 if Branch of the If Activity"
  5. Click OK.
  6. Drag and define additional activities into the if condition, as needed. These activities are executed if the if condition evaluates to true.
  7. Click the elseif branch (if you added this branch).
  8. In the Condition field, enter a condition, as shown in Figure 11-3.

    Figure 11-3 elseif Branch of the If Activity

    Description of Figure 11-3 follows
    Description of "Figure 11-3 elseif Branch of the If Activity"
  9. Click OK.
  10. If you want to add elseif conditions, highlight the If activity, and select the Add icon to invoke a menu.
  11. Drag and define additional activities into the elseif condition, as needed. These activities are executed if the if branch did not evaluate to true, and this elseif branch evaluates to true.
  12. Click the else label.
  13. Enter a condition or drag and define additional activities into the else condition, as needed. These activities are executed if the if and any elseif branches did not evaluate to true, and this else branch evaluates to true.

    Figure 11-4 shows a completed if activity in which each branch includes contained activities.

    Figure 11-4 Completed If Activity

    Description of Figure 11-4 follows
    Description of "Figure 11-4 Completed If Activity"