Wednesday, January 13, 2010

Compensation Handler implementation example.

Here is simple BPEL flow view that gives you an example of how to implement the compensation handler.

See the the following diagram with simple assign and compensation activities along with compansation handler block.

Details:
Compensations consist of 2 parts, the compensation handler, and the compensate activity

•Each scope can have one compensation handler

•A compensation handler defines an undo sequence for the scope it is bound to.

•A compensation handler can be called by a compensate activity

•A compensate activity should be in the outer scope, which calls the inner scope's compensation handler just by specifying its name.

•A compensation handler of the scope belongs to the scope where the exception is thrown will not be executed. Only the previous scope's compensation handlers will be executed successfully upon calling the scope name from outside compansate activity.

•A compensate activity will be used only in the compansate handler or in side the exception blocks of the BPEL process.




Note: In the assign activities use your own assigns with some hard coding strings. Use some string for the if contistion say ( input value = 'MYINPUTSTRING'). Pass this "MYINPUTSTRING" string during the testing process to throw the error.
For more details read here

Enjoy.... provide your comments for any questions.

Thanks...

Khaleel Shaik

No comments: