How to Catch BPEL Runtime Faults

11-26 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 11–3 Throw Dialog

7. Click Apply, then OK.

11.7.2 What Happens When You Create a Throw Activity

Example 11–20 shows the throw activity in the .bpel file after design completion. The OrderProcessor process terminates after executing this throw activity. Example 11–20 Throw Activity throw name=Throw_Fault_CC_Denied faultName=client:OrderProcessorFault

11.8 Rethrowing Faults with the Rethrow Activity

The rethrow activity rethrows faults originally captured by the immediately enclosing fault handler. Only use the rethrow activity within a fault handler for example, within catch and catchAll activities. The rethrow activity is used in fault handlers to rethrow the captured fault that is, the fault name and the fault data if present of the original fault. The rethrow activity must ignore modifications to fault data. For example: ■ If the fault handler modifies fault data and then calls a rethrow activity, the original fault data is rethrown, and not the modified fault data. ■ If a fault is captured using the functionality that enables message type faults with one part defined using an element to be caught by fault handlers looking for the same element type, then the rethrow activity rethrows the original message type data.

11.8.1 How to Create a Rethrow Activity

To create a rethrow activity: 1. In the Component Palette, expand BPEL Constructs. 2. Drag a Rethrow activity into the designer. Note: This activity is supported in BPEL version 2.0 projects. Using Fault Handling in a BPEL Process 11-27

3. Double-click and define the Rethrow activity.

4. Optionally enter a name or accept the default value, as shown in Figure 11–4 . Figure 11–4 Rethrow Dialog

5. Click Apply, then OK.

When complete, design can look similar to that shown in Figure 11–5 . Figure 11–5 Throw Activity in BPEL Process

11.8.2 What Happens When You Rethrow Faults

Example 11–21 shows the .bpel file after design is complete for a rethrow activity. The rethrow activity is inside a fault handler catch activity. Example 11–21 Rethrow Activity scope name=scope1 faultHandlers catch faultName=tns:error faultVariable=tmpVar faultElement=tns:fault sequence