What Happens When You Create a Catch Activity in a Scope What Happens When You Create an Empty Activity

Using Fault Handling in a BPEL Process 11-37 Figure 11–12 Empty Activity 4. Optionally enter a name.

5. Click OK.

11.10.9 What Happens When You Create an Empty Activity

The syntax for an empty activity is shown in Example 11–27 . Example 11–27 Empty Activity empty standard-attributes standard-elements empty If no catch or catchAll is selected, the fault is not caught by the current scope and is rethrown to the immediately enclosing scope. If the fault occurs in or is rethrown to the global process scope, and there is no matching fault handler for the fault at the global level, the process terminates abnormally. This is as though a terminate activity described in Section 11.13.1, Stopping a Business Process Instance with the Terminate Activity in BPEL 1.1 had been performed.

11.11 Re-executing Activities in a Scope Activity with the Replay Activity

You can create a replay activity inside a scope activity to re-execute all of the activities inside the scope.

11.11.1 How to Create a Replay Activity

To create a replay activity: 1. In the Component Palette, expand Oracle Extensions. 2. Drag a Replay activity into the designer. 3. Double-click the Replay activity. 4. Enter an optional name. 5. Select the scope to re-execute, as shown in Figure 11–13 . 11-38 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 11–13 Replay Dialog

6. Click Apply, then click OK.

7. Continue with the design of your scope activity. When complete, design of the scope activity can look similar to that shown in Figure 11–14 . Figure 11–14 Replay Activity in a Scope Activity

11.11.2 What Happens When You Create a Replay Activity

Example 11–28 shows the .bpel file after design is complete for a replay activity in a BPEL project that supports BPEL version 2.0. In BPEL 2.0, the replay activity is wrapped in an extensionActivity element. Example 11–28 Replay Activity scope name=scope2 sequence assign Using Fault Handling in a BPEL Process 11-39 copy fromcounter2 + 1from tocounter2to copy assign scope name=scope3 sequence assign copy fromcounter + 1from tocounterto copy assign if conditioncounter = 3condition empty else extensionActivity bpelx:replay name=ReplayScope scope=scope2 extensionActivity else if sequence scope sequence scope In BPEL 1.1, the replay activity is coded as a bpelx extension. bpelx:replay name=ReplayScope scope=Scope2

11.12 Using Compensation After Undoing a Series of Operations

Compensation occurs when the BPEL process service component cannot complete a series of operations after some have completed, and the BPEL process service component must backtrack and undo the previously completed transactions. For example, if a BPEL process service component is designed to book a rental car, a hotel, and a flight, it may book the car and the hotel and then be unable to book a flight for the right day. In this case, the BPEL flow performs compensation by going back and unbooking the car and the hotel. In a scope activity, the compensation handler can reverse previously completed process steps. The compensation handler can be invoked after successful completion of its associated scope with either of the following activities. ■ Compensate activity in BPEL version 1.1 and 2.0 projects This activity causes the compensation handler of all successfully completed and not yet compensated child scopes to be executed in default order. ■ compensateScope activity in a BPEL version 2.0 project This activity causes the compensation handler of one specific successfully completed scope to be executed.

11.12.1 Using a Compensate Activity

You can invoke a compensation handler by using the compensate activity, which names the scope for which the compensation is to be performed that is, the scope whose compensation handler is to be invoked. A compensation handler for a scope is