Book Image

WS-BPEL 2.0 Beginner's Guide

Book Image

WS-BPEL 2.0 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
WS-BPEL 2.0 Beginner's Guide
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 11. Compensations

Suppose you need to write a book on ordering process. This might include two main tasks: order registration and charging the client's credit card.

Imagine there is not enough credit in the customer's credit card when initiating a credit card transaction. In this case, we need to rollback a "Register Book Order" activity in order to avoid financial losses to the bookseller. This is where we need to have compensations in the BPEL processes. The already completed tasks can be rolled backed. In the preceding example, the BPEL process should implement necessary activities to cancel the book order during the compensation.

When using a self-contained synchronous system, all information is available during a change to simply roll the change back if an error or unexpected situation occurs. However, in a BPEL environment, things are often not self-contained, and a change needs to be committed to move on. If any error or unexpected situation occurs after this commit, a...