Using a Compensate Activity

Using Fault Handling in a BPEL Process 11-41 Figure 11–15 Compensate Activity

5. Click Apply, then OK.

11.12.3 What Happens When You Create a compensate Activity

If an invoke activity has a compensation handler defined inline, then the name of the activity is the name of the scope to be used in the compensate activity. The syntax is shown in Example 11–29 : Example 11–29 Compensation Handler compensate scope=ncname? standard-attributes standard-elements compensate

11.12.4 Using a compensateScope Activity in BPEL 2.0

The compensateScope activity is used to start compensation on a specified inner scope that has already completed successfully. This activity must only be used from within a fault handler, another compensation handler, or a termination handler. When you create a compensateScope activity, you select a target that must refer to the immediately-enclosed scope. The scope must include a fault handler or compensation handler.

11.12.5 How to Create a compensateScope Activity

To create a compensateScope activity: 1. In the Component Palette, expand BPEL Constructs. 2. Drag a CompensateScope activity into the designer 3. Double-click the CompensateScope activity. Note: This activity is supported in BPEL 2.0 projects. 11-42 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite 4. Select a specific scope activity in which to invoke the compensation handler. Figure 11–16 provides details. Figure 11–16 CompensateScope Activity

5. Click Apply, then OK.

11.12.6 What Happens When You Create a compensateScope Activity

Example 11–30 shows the .bpel file after design is complete for a compensateScope activity. The compensateScope activity is defined in a catchall fault handler. The scope in which to invoke the compensation handler is defined. Example 11–30 compensateScope Activity scope name=ScopeAssignCreditRating faultHandlers catchAll compensateScope target=ScopeAssignScreditRating2 catchAll faultHandlers sequence scope name=ScopeAssignScreditRating2 compensationHandler -- undo work -- compensationHandler -- do some work -- scope -- do more work -- -- a fault is thrown here; results of ScopeAssignScreditRating2 must be undone -- sequence scope

11.13 Stopping a Business Process Instance

You can stop a business process instance with either of the following activities: ■ Terminate activity in a BPEL version 1.1 project