Synchronous and asynchronous flows

WebSphere Partner Gateway supports synchronous and asynchronous flows with sending and receiving trading partners. Synchronous interaction involves response business documents. This means that if a sending trading partner invokes WebSphere Partner Gateway synchronously, it expects a business-protocol-level synchronous response. Similarly, if WebSphere Partner Gateway invokes a receiving trading partner synchronously, it expects a synchronous business-protocol-level response. Note that synchronous and asynchronous interactions are dictated by the business protocol requirements and trading partner agreements. Synchronous interactions depend on the nature of the transports used as well. For example, in the case of HTTP, send the response in the same HTTP connection.

This section explains how you can use the user exit capabilities of WebSphere Partner Gateway to develop synchronous and asynchronous flows. The following table lists the various types of document flows that can be supported between a sending trading partner, WebSphere Partner Gateway, and a receiving trading partner.

Table 1. Types of document flows
Sending trading partner WebSphere Partner Gateway Receiving trading partner
A. Sends a business document (asynchronous)
  1. WebSphere Partner Gateway receiver receives the business document. SyncCheck handler returns false for this business document. Receiver introduces the document into document processor. (Receiver and receiver handlers).
  2. WebSphere Partner Gateway unpackages the document and parses the document to determine participant connection. (Un-packaging handler, protocol processing handler). This also determines sending and receiving trading partners for this document.
  3. WebSphere Partner Gateway performs business protocol specific processing on the request business document. (Actions and their steps).
  4. WebSphere Partner Gateway packages the business document in the packaging determined by the participant connection, as expected by receiving trading partner. (Protocol Packaging handler).
  5. WebSphere Partner Gateway sends the document to receiving trading partner asynchronously. (Sender and handlers).
Receives the business document (asynchronous)
B. Sends a business document (asynchronous)

The processing steps are the same as in A above. However, the protocol packaging handler sets the BCGDocumentConstants.BCG_GET_SYNC_RESPONSE attribute on the business document, which causes the sender to send the request document synchronously to the receiving trading partner. The sender waits to receive the response business document.

The response business document received by the sender is introduced into the Document Manager by the Delivery Manager. This document is processed like any other document.

C. Sends the request business document synchronously to WebSphere Partner Gateway. Synchronously receives response business document from WebSphere Partner Gateway.

The processing steps are the same as in A above. However, the protocol packaging handler sets the BCGDocumentConstants.BCG_GET_SYNC_RESPONSE attribute on the business document, making the sender send the request document synchronously to the receiving trading partner. The sender waits to receive the response business document.

Note the following points in this scenario:

  • The sending trading partner of the response document is the trading partner who received the request business document.
  • The receiving trading partner of response document is the trading partner who sent the request business document.

After the sender receives the response business document, it is processed as follows:

  1. SenderFramework introduces the response business document into the Document Manager.
  2. The unpackaging handler unpackages the document, and the protocol processing handler parses the response document to determine the participant connection.
  3. WebSphere Partner Gateway performs business-protocol-specific processing (actions and their steps) on the response business document.
  4. The protocol packaging handler packages the response business document in the packaging as expected by the receiving trading partner and determined by the participant connection for this document.
  5. Since the request document was received synchronously by the WebSphere Partner Gateway receiver, the response is sent by the receiver (and postprocessing handler) to the trading partner.
Receives the business document (synchronous). Responds synchronously with business document.
Note: If an error occurs during the flow of either the request or the response business document, any of the user exits can set the BCGDocumentConstants.BCG_RESPONSE_STATUS attribute on the business document object. Set the value of this attribute with the error status to be sent synchronously to the trading partner who sent the request document.

Copyright IBM Corp. 2003, 2005