If

See Also

The If activity supports conditional behavior of a business process instance. The If activity consists of conditional branches defined by the If and ElseIf elements, followed by an optional Else branch. The conditions on If and ElseIf branches are evaluated in the order they appear. During execution, the first branch whose condition holds true is taken and provides the activity specified for the If activity. In other words, if there are several ElseIf branches whose conditions hold true, only the first of them will be executed.

If none of the branches holds true, then the Else path is chosen. If the Else branch is not explicitly specified, this branch is considered to have an Empty activity. The If activity is complete when the activity of the selected branch completes.

Using the BPEL Designer, you add branches to the If element as follows:

To use the If element:

  1. In the Design view, drag the If element from the Palette to the diagram.
  2. Select the If element on the diagram.
    The Properties window shows the If properties (Ctrl-Shift-7).
  3. (Optional) In the Properties window, enter the name for the If element.
  4. Drag the activity that will be executed onto the If branch. Configure the activity's properties.
  5. Specify the condition for the If branch by using either of the following methods:
  6. Add other branches (ElseIf and Else) as described below.

To add an ElseIf branch to the If element:

  1. Right-click the If element and choose Add ElseIf..
  2. Place the ElseIf activity to the target place.
  3. Add an activity to the ElseIf that will be executed if the condition defined for this ElseIf is true.
    To define a condition, use the BPEL Mapper.
  4. (Optional) Add more ElseIf activities by choosing Add ElseIf and add activities to them.

To add an Else branch to the If element:

To reorder ElseIf branches:

See Also
About the BPEL Mapper
BPEL Designer Palette: Structured Activities
About the Design View of the BPEL Designer

Legal Notices