This documentation is for WSO2 Enterprise Integrator version 6.5.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc
||
Skip to end of metadata
Go to start of metadata

Compensation refers to reversing the effects of a service invocation when a failure occurs. Compensation handling is the act of undoing any actions that were performed by a successfully completed compensatable activity because of an exception that occurred elsewhere in a workflow. This sample demonstrates compensation handling when booking a hotel, car, and airline ticket. If the airline ticket fails, the hotel and car bookings should be cancelled by calling the appropriate compensation handlers.

Setting up the sample

  1. Log into the BPS Server Management Console.
  2. On the Main tab, under Processes, click Add.
  3. Upload the <EI_HOME>/samples/business-process/bpel/FlightReservationProcess.zip directory. 
  4. Under Processes, click List, and then click the process ID for FlightReservationProcess (CompensationProcess).
  5. Scroll down to see the process visualization.

You can see in the TravelPlanProcess flow that the sequence first books the car, then the hotel, and then the flight. If the flight booking fails, the fault handler calls the compensation handlers for the hotel and car.

Running the sample

  1. In the WSDL details area, click Try It.
    The TravelPlanService appears in a separate TryIt window.
  2. In the TryIt window, click Send.
  3. In the Management Console, under Business Processes click Instances.

The CompensationProcess instance should now be listed. You can click the instance ID to see its details, including its variable values and activity.

  • No labels