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 – adding a message handler to the BPEL process


Let's now add the event handler to the main book warehousing BPEL process. First, we will add an alarm event handler for the maximal execution time of a BPEL process. Then, we will add a message event handler, which will allow the cancelation of a running BPEL process instance.

We will proceed as follows:

  1. Open the BookWarehousingBPEL.bpel process.

  2. On the left-hand side, select the Add OnEvent icon, which is just above the Add OnAlarm icon, which we selected earlier.

  3. Scroll to the right-hand side of the BPEL process, and you should see that an OnEvent event handler has been added to the BPEL process flow:

What just happened?

We have added an OnEvent event handler to our BPEL process. The following code has been added to the BPEL process:

Declaring a cancel operation on the BPEL interface

For the OnEvent event handler, we need to specify the partner link, port type, and operation name which will trigger the event. Similar to the alarm...