Enter a boolean XPath expression condition, and click OK.

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. Using Conditional Branching in a BPEL Process 10-13 Example 10–8 Built-in and Custom XPath Functions and variable References assign bpelx:skipCondition=bpws:getVariableData crOutput, payload, tns:rating 0 assign bpelx:skipCondition=custom:validateRating ... assign xmlns:fn=http:www.w3.org2005xpath-functions bpelx:skipCondition=fn:false ... If an error is thrown by the XPath expression evaluation, the error is wrapped with a BPEL fault and thrown from the activity. An event is added to the BPEL instance audit trail for activities that are bypassed due to the skip condition expression evaluating to true. Even if the skip condition evaluates to false meaning the activity is performed, the fact that a skip condition expression was evaluated is still logged to the audit trail for debugging purposes. If the XPath engine fails to evaluate the boolean value, bpws:subLanguageFault is thrown. This is the same fault thrown when a switchcase condition does not evaluate to a boolean value. This is also logged to the audit trail for debugging purposes.

10.5.1 How to Specify XPath Expressions to Bypass Activity Execution

To specify XPath expressions to bypass activity execution: 1. In the Component Palette, expand BPEL Constructs. 2. Drag the activity into the designer in which to create the skip condition.

3. Click the Skip Condition tab.

4. Specify an XPath expression that, when evaluated to true, causes an activity to be skipped. Figure 10–13 provides details. Figure 10–13 Skip Condition XPath Expression