Introduction to Technology Adapters

5 Introduction to Interaction Patterns in a BPEL Process 5-1 5 Introduction to Interaction Patterns in a BPEL Process This chapter describes common interaction patterns between a BPEL process service component and an external service, and shows the best use practices for each. This chapter includes the following sections: ■ Section 5.1, Introduction to One-Way Messages ■ Section 5.2, Introduction to Synchronous Interactions ■ Section 5.3, Introduction to Asynchronous Interactions ■ Section 5.4, Introduction to Asynchronous Interactions with a Timeout ■ Section 5.5, Introduction to Asynchronous Interactions with a Notification Timer ■ Section 5.6, Introduction to One Request, Multiple Responses ■ Section 5.7, Introduction to One Request, One of Two Possible Responses ■ Section 5.8, Introduction to One Request, a Mandatory Response, and an Optional Response ■ Section 5.9, Introduction to Partial Processing ■ Section 5.10, Introduction to Multiple Application Interactions

5.1 Introduction to One-Way Messages

In a one-way message, or fire and forget, the client sends a message to the service d1 in Figure 5–1 , and the service is not required to reply. The client sending the message does not wait for a response, but continues executing immediately. Example 5–1 shows the portType and operation part of the BPEL process WSDL file for this environment. Example 5–1 One-Way WSDL File . . . wsdl:portType name=BPELProcess1 wsdl:operation name=process wsdl:input message=client:BPELProcess1RequestMessage wsdl:operation wsdl:portType . . . Figure 5–1 provides an overview. 5-2 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 5–1 One-Way Message BPEL Process Service Component as the Client As the client, the BPEL process service component needs a valid partner link and an invoke activity with the target service and the message. As with all partner activities, the Web Services Description Language WSDL file defines the interaction. BPEL Process Service Component as the Service To accept a message from the client, the BPEL process service component needs a receive activity.

5.2 Introduction to Synchronous Interactions

In a synchronous interaction, a client sends a request to a service d1 in Figure 5–2 , and receives an immediate reply d2 in Figure 5–2 . A BPEL process service component can be at either end of this interaction, and must be coded based on its role as either the client or the service. For example, a user requests a subscription to an online newspaper and immediately receives email confirmation that their request has been accepted. Example 5–2 shows the portType and operation part of the BPEL process WSDL file for this environment. Example 5–2 Synchronous WSDL File . . . wsdl:portType name=BPELProcess1 wsdl:operation name=process wsdl:input message=client:BPELProcess1RequestMessage wsdl:output message=client:BPELProcess1ResponseMessage wsdl:operation wsdl:portType Figure 5–2 provides an overview. Client BPEL Process WSDL PartnerLink Service BPEL Process receive d1 invoke