What Happens When You Create a Switch Activity

10-6 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite else if

10.2.2.1 How to Create an If Activity

To create an If activity: 1. In the Component Palette, expand BPEL Constructs. 2. Drag an If activity into the designer. The if and else conditions are displayed, as shown in Figure 10–6 . Figure 10–6 If Activity

3. If you want to add elseif conditions, highlight the If activity, and select the Add

icon to invoke a menu.

4. Click the if branch.

5. In the Condition field, enter a condition, as shown in

Figure 10–7 . You can also click the XPath Expression Builder icon to invoke the Expression Builder dialog. Figure 10–7 if Branch of the If Activity

6. Click OK.

7. Drag and define additional activities into the if condition, as needed. These

activities are executed if the if condition evaluates to true.

8. Click the elseif branch if you added this branch.

9. In the Condition field, enter a condition, as shown in

Figure 10–8 . Using Conditional Branching in a BPEL Process 10-7 Figure 10–8 elseif Branch of the If Activity

10. Click OK.

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 10–9 shows a completed if activity in which each branch includes contained activities. Figure 10–9 Completed If Activity

10.2.2.2 What Happens When You Create an If Activity

Example 10–3 provides an example of the .bpel file after design completion. The if activity has if, elseif, and else branches defined. The first branch to evaluate to true is executed. Example 10–3 If Activity sequence -- receive input from requestor -- receive name=receiveInput partnerLink=client portType=tns:Test operation=process variable=input createInstance=yes -- assign default value -- assign copy