Friday, 6 July 2012

Compensate Activity in BPEL 11g

Compensate Activity in BPEL

This activity invokes compensation on an inner scope activity that has successfully completed. This activity can be invoked only from within a fault handler or another compensation handler. Compensation occurs when a process cannot complete several operations after completing others. The process must return and undo the previously completed operations. For example, assume a process is designed to book a rental car, a hotel, and a flight. The process books the car and the hotel, but cannot book a flight for the correct day. In this case, the process performs compensation by unbooking the car and the hotel.The compensation handler is invoked with the compensate activity, which names the scope on which the compensation handler is to be invoked.

Figure A-7 shows the Compensate dialog in BPEL 1.1. You can perform the following tasks:

·    Click the General tab to provide the activity with a meaningful name.
·    Select the scope activity on which the compensation handler is to be invoked.

Figure A-7 Compensate Dialog

In BPEL 2.0, the Compensate dialog does not include a Skip Condition tab.

Compensate Scope Activity

This activity enables you 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.

Note: This activity is only supported in BPEL 2.0 projects.
Figure A-8 shows the CompensateScope dialog.

Figure A-8 CompensateScope Dialog