In the Description field, enter a description of the capabilities of this condition In the Condition field, click the Expression Builder icon to access the Expression

Using Conditional Branching in a BPEL Process 10-5 name=Choose_the_Loan_with_the_Lower_APR bpelx:annotation bpelx:general bpelx:property name=userLabelChoose the Loan with the Lower APRbpelx:property bpelx:general bpelx:annotation assign name=selectUnitedLoan copy from variable=loanOffer1 part=payload from to variable=selectedLoanOffer part=payload copy assign case otherwise assign name=selectStarLoan copy from variable=loanOffer2 part=payload from to variable=selectedLoanOffer part=payload copy assign otherwise switch

10.2.2 Defining Conditional Branching with the If Activity in BPEL 2.0

You can use an if activity when conditional behavior is required for specific activities to decide between two or more branches. Only one activity is selected for execution from a set of branches. The if activity consists of a list of one or more conditional branches that are considered for execution in the following order: ■ The if branch ■ Optional elseif branches ■ An optional else branch The first branch whose condition evaluates to true is taken, and its contained activity is performed. If no branch with a condition is taken, then the else branch is taken if present. The if activity is complete when the contained activity of the selected branch completes, or immediately when no condition evaluates to true and no else branch is specified. The if activity is a BPEL version 2.0 feature that replaces the switch activity that was included in BPEL version 1.1. Example 10–2 shows the if activity syntax. Example 10–2 If Activity if standard-attributes standard-elements conditionsome conditon expressioncondition activity elseif conditionsome condition expressioncondition some activity elseif else? some 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.