In this chapter, we will learn about the concept of one request and one of two possible responses.
The Client BPEL Process sends a single request to the Service BPEL Process and receives one of two possible responses.
For example, the request can be to order a product online, and the first response can be either an in-stock message, or an out-of-stock message.
The Client BPEL Process needs the following −
An invoke activity to send the request.
A pick activity with two branches: one onMessage for the in-stock response and instructions on what to do if an in-stock message is received.
A second onMessage for the out-of-stock response and instructions on what to do if an out-of-stock message is received.
The Service BPEL Process needs a receive activity to accept the message from the client, and a switch activity with two branches, one with an invoke activity sending the in-stock message if the item is available, and a second branch with an invoke activity sending the out-of-stock message if the item is not available.
As with all partner activities, the Web Services Description Language (WSDL) file defines the interaction.