The If activity supports conditional behavior of a business process instance. The If activity consists of conditional branches defined by the If and Else If elements, followed by an optional Else branch. The conditions on If and Else If 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 Else If branches whose conditions hold true, only the first of them will be executed.
If none of the branches evaluates to true, then the Else path is chosen. If the Else branch is not explicitly specified, this branch is considered to contain an Empty activity. The If activity is complete when the activity of the selected branch completes.
In the Design view, drag the If element from the Palette to the diagram.
Double-click the If element on the diagram or select the Mapper tab on the toolbar. The BPEL Mapper opens.
Specify the condition for the If element using the BPEL Mapper. For more information, refer to the If Activity Scenario section of the guide. You can also specify the condition manually in the Properties window, invoked by right-clicking the element and choosing Properties.
(Optional) In the Properties window, enter the name for the If element.
Add the element that will be executed if the condition is true into the If element. Configure the nested element. If you add another element into the If element, the nested elements are automatically wrapped in the Sequence element.
Add other branches (Else If and Else) as described below.
Right-click the If element and choose Add Else If.
Add an activity to the Else If that will be executed if the condition defined for this Else If element is true. To define a condition, use the BPEL Mapper.
(Optional) Add more Else If activities by choosing Add Else If and add activities to them.
Drag the activity you want to be executed on the Else branch onto the connector path marked with a slash mark. Configure the nested activity.
In the Design view, drag the Else If branch that you want reordered and drop it onto the placeholder that appears next to another Else If branch.