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

What just happened?

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

What just happened?

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 event, we need to add a new operation to the process interface. We will name the operation cancel.

We will add the cancel operation to the BPEL process WSDL interface. Namely, this time the client needs to call the BPEL process in order to cancel the process instance. This requires that we add a cancel operation to the BPEL process WSDL interface.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.167.22