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

Time for action – triggering a fault within the BPEL process


So far, we implemented two <scope> activities that model the book ordering process. However, to trigger <compensationHandler> of the <scope> activities, we need to have either <catch>, <catchAll>, <compensationHandler>, or <terminationHandler>. We will use <catchAll>, and inside this, we will trigger <compensationHandler>. To trigger <catchAll>, we need to throw an explicit fault after the execution of the two scopes. Next, we learn how to throw this fault.

Carry out the following steps:

  1. Add a <sequence> activity named throwFault after the <scope> activity named initiateCreditCardTransaction. Then, drag-and-drop an <if> activity within it and specify its condition, as shown in the following screenshot. This condition will check the content of inputVariable and check whether it contains the compensate value:

  2. Add a <throw> activity inside it, so if the...