What Happens When You Create a While Activity

Using Conditional Branching in a BPEL Process 10-11 Figure 10–11 Completed Repeat Until Dialog

7. Click Apply, then OK.

8. Expand the Repeat Until activity, as shown in

Figure 10–12 . Figure 10–12 repeatUntil Activity Being Expanded

9. Design the body of the activity by dragging in activities from the Component

Palette and defining their property values. These activities are evaluated until the XPath expression condition is evaluated to true.

10.4.2 What Happens When You Create a repeatUntil Activity

Example 10–5 provides an example of the .bpel file after design completion. In this scenario, purchase order validation must be performed at least once, then repeatedly, based on evaluating the completion status until the status is updated to 5. Example 10–5 repeatUntil Activity repeatUntil sequence invoke name=PurchaseOrderValidation ... receive name=receiveValidation partnerLink=PurchaseOrderValidation operation=returnPurchaseOrderValidation variable=PurchaseOrderStatusResponse sequence condition bpel:getVariableProperty PurchaseOrderStatusResponse,tst:completionStatus 5 condition repeatUntil 10-12 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite

10.5 Specifying XPath Expressions to Bypass Activity Execution

You can specify an XPath expression in an activity that, when evaluated to true, causes that activity to be skipped. This functionality provides an alternative to using a switch activity for conditionally executing activities. The skip condition for activities is specified as follows: activity bpelx:skipCondition=boolean-expr The bpelx:skipCondition attribute causes an XPath expression to be evaluated immediately upon creation of the activity instance. If the skip expression returns a false boolean value, the activity is executed. If the skip expression returns a true boolean value, the activity is completed immediately and execution moves to the activity immediately following that one. This construct is equivalent to a switchcase structured activity with a single case element with a condition that is the opposite of the skip condition. Example 10–6 provides an example of bpelx:skipCondition attribute use. If myvalue is 0, the expression evaluates to true, and the assign activity is skipped. If myvalue is 10, the expression evaluates to false, and the copy operation of the assign activity is executed. Example 10–6 Use of bpelx:skipCondition Attribute assign bpelx:skipCondition=bpws:getVariableDatainput, payload,tns:inputMsgtns:myvalue = 0 copy from expression=Value is greater than zero to variable=output part=payload query=tns:resultMsgtns:valueResult copy assign The equivalent functionality used with a switch activity is shown in Example 10–7 . Example 10–7 Equivalent Functionality with a Switch Activity switch case condition=bpws:getVariableDatainput, payload,tns:inputMsgtns:value 0 assign copy from expression=Value is greater than zero to variable=output part=payload query=tns:resultMsgtns:valueResult copy assign case switch You can also use built-in and custom XPath functions and variable references within the skip condition expression. Example 10–8 provides several examples: Note: The skip condition is only available in BPEL projects that support BPEL version 1.1.