Introduction to One Request, Multiple Responses

5-8 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 5–7 One Request, One of Two Possible Responses BPEL Process Service Component as the Client When the BPEL process service component is on the client side of this transaction, it 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 As with all partner activities, the WSDL file defines the interaction. For more information about interactions using one request and one of two possible responses, see Section 14.2, Creating a Pick Activity to Select Between Continuing a Process or Waiting. BPEL Process Service Component as the Service The BPEL service 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.

5.8 Introduction to One Request, a Mandatory Response, and an Optional Response

In this type of interaction, the client sends a single request to a service and receives one or two responses. Here, the request is to order a product online. If the product is delayed, the service sends a message letting the customer know. In any case, the service always sends a notification when the item ships. Figure 5–8 provides an overview. onMessage A Logic A Logic B onMessage B pick Client BPEL Process WSDL PartnerLink d1 Call service invoke Service BPEL Process Item in stock? invoke Msg A invoke Msg B otherwise switch receive Msg A or Msg B Introduction to Interaction Patterns in a BPEL Process 5-9 Figure 5–8 One Request, a Mandatory Response, and an Optional Response BPEL Process Service Component as the Client When the BPEL process service component is on the client side of this transaction, it needs a scope activity containing the invoke activity to send the request, and a receive activity to accept the mandatory reply. The onMessage handler of the scope activity is set to accept the optional message and instructions on what to do if the optional message is received for example, notify you that the product has been delayed. The client BPEL process service component waits to receive the mandatory reply. If the mandatory reply is received first, the BPEL process service component continues without waiting for the optional reply. As with all partner activities, the WSDL file defines the interaction. BPEL Process Service Component as the Service The BPEL service needs a scope activity containing the receive activity and an invoke activity to send the mandatory shipping message, and the scope’s onAlarm handler to send the optional delayed message if a timer expires for example, send the delayed message if the item is not shipped in 24 hours.

5.9 Introduction to Partial Processing

In partial processing, the client sends a request to a service and receives an immediate response, but processing continues on the service side. For example, the client sends a request to purchase a vacation package, and the service sends an immediate reply confirming the purchase, then continues on to book the hotel, the flight, the rental car, Client BPEL Process WSDL PartnerLink d1 scope Call service invoke onMessage A Notify User of Delay Wait for Callback receive Msg B Msg B Msg A maybe Service BPEL Process receive When product ships... invokes Msg B Delay? invoke Msg A otherwise switch