Managing Events
A business process may have to react on certain events. We already know that a business process specified in BPEL usually waits for an incoming message using the <receive>
activity. This incoming message is the event that activates the whole process. A business process also often invokes web service operations asynchronously. For such operations, results are returned using callbacks. The BPEL process often waits for callback messages, which are also events.
Using the <receive>
activity, we can wait for an exactly specified message on a certain port type. Often, however, it is more useful to wait for more than one message, of which only one will occur. Let us go back to our example, where we invoked the FlightAvailability
operation and waited for the Fl
ightTicketCallback
callback. In a real-world scenario, it would be very useful to wait for several messages, FlightTicketCallback
being one of them. The other messages could include FlightNotAvaliable
, TicketNotAvaliable...