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:
BookWarehousingBPEL.bpel
process.We have added an OnEvent event handler to our BPEL process. The following code has been added to the BPEL process:
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.