To add the
cancel
operation to the BPEL process WSDL interface, we will proceed as follows:
BookWarehousingBPEL.wsdl
interface.BookWarehousingBPEL
port type. We can see that the port type specifies a single process
operation:cancel
operation, which the client will use to cancel the running BPEL instance. In our example, we will use the same input message as in the process
operation:cancel
operation as the trigger for the OnEvent event handler. We will open the BookWarehousingBPEL.bpel
process and double click on the OnEvent activity.cancelInputMessage
name and select Message Type as BookWarehousingBPELRequestMessage
, as shown in the following screenshot:We have added the cancel
operation declaration to the WSDL interface of the BPEL process. We will use this operation to cancel the current running process instance.
We have also specified that this operation is the trigger for the OnEvent
message handler, which has generated the following code:
Next, we will add the message event activities. This means that we will specify the activities that should be performed once the cancel
operation triggers our event handler.
We will throw a fault with the name CancelInstance
and terminate the process instance. We have chosen to throw the fault, as this would allow a BPEL process to invoke compensation and termination handlers, if present. We will see more on compensation in Chapter 11, Compensations.