Configuring document processing components with handlers

This section describes, in more detail, the components of WebSphere Partner Gateway and shows you the various points at which you can (or must) change the system-supplied behavior of the components for processing a business document.

You use handlers to change the system-supplied behavior of targets, gateways, fixed workflow steps, and actions. There are two types of handlers--those supplied by WebSphere Partner Gateway and those that are user-defined. See the Programmer Guide if you want information about creating handlers.

After a handler is created, you upload it to make it available. You upload only user-defined handlers. The handlers supplied by WebSphere Partner Gateway are already available.

The sections that follow describe the processing points at which you can specify handlers.

Targets

Targets have three configuration points for which handlers can be specified--Preprocess, SyncCheck, and Postprocess.

Figure 8. Target configuration points
This figure shows how a document goes through the Preprocess and SyncCheck steps before being received by the Document Manager and how the Postprocess step is optionally used for the response from the Document Manager in a synchronous transaction

The processing occurs in the following order:

  1. The Receiver calls the Preprocess and SyncCheck steps after it receives the document.
  2. It then calls the Document Manager to process the document.
  3. In the case of synchronous flows, the Document Manager provides a Sync Response. The Receiver then calls the Postprocess step with the response returned from the Document Manager.

The steps are described in the following sections:

Document Manager

Documents received by targets are picked up by the Document Manager from the common file system for further processing. The Document Manager uses participant connections to route the documents. All documents flowing through the Document Manager go through a series of workflows: fixed inbound workflow, variable workflow, and fixed outbound workflow. At the end of the inbound workflow, the participant connection is determined. The participant connection specifies the action to perform on this document. After executing the variable workflow, the Document Manager executes the fixed outbound workflow on this document.

Figure 9. Fixed workflows and actions
This figure shows the flow of documents from the inbound fixed workflow steps, through an action, and to an outbound fixed workflow step

Figure 9 shows the path that a document such as a RosettaNet PIP or a Web service would take. Some documents, however, require several configured flows. For example, an EDI interchange can consist of multiple transactions. The first flow uses an action to de-envelope the set of individual transactions. Each of these transactions is reintroduced and processed in its own configured flow.

Figure 10. Fixed workflows and actions for an EDI interchange
This figure shows how an EDI interchange is processed by the fixed inbound workflow and how the de-enveloping action creates multiple transactions, which are reprocessed by the fixed inbound workflow

Inbound fixed workflow

The Inbound fixed workflow consists of the standard set of processing steps performed on all documents coming into the Document Manager from a Receiver. The workflow is fixed because the number and types of steps are always the same. Through user exits, however, you can provide customized handlers for processing the following steps: Protocol Unpackaging and Protocol Processing. The last step of inbound fixed workflow performs participant connection lookup, which determines the variable workflow that executes for this business document.

For example, if an AS2 message is received, the message is decrypted, and the sender and receiver business IDs are retrieved. The inbound fixed workflow steps convert the AS2 document into plain text for further processing by WebSphere Partner Gateway and extract information to determine the action for the message.

Figure 11. Inbound fixed workflow steps
This figure shows that, within the inbound fixed workflow, a document flows through the Protocol Unpackaging step and the Protocol Processing step
Protocol Unpackaging

During Protocol Unpackaging, a document is unpackaged so that it can be further processed. This process can include decryption, decompression, signature verification, extraction of routing information, user authentication, or business document parts extraction.

WebSphere Partner Gateway provides handlers for RNIF, AS, Backend Integration, and None packaging. If handlers for other packaging types are necessary, they can be developed as user exits. Refer to the Programmer Guide for information about writing user exits.

You cannot modify the Protocol Unpackaging step; however, you can add business logic to the step by adding handlers.

See Configuring fixed workflows for information about configuring this step.

Protocol Processing step

Protocol Processing involves determining protocol-specific information, which might include parsing the message to determine routing information (such as the sender ID and the receiver ID), protocol information, and document flow information. WebSphere Partner Gateway provides processing for a variety of protocols, as listed in Protocol processing handlers. Processing for other protocols--for example, CSV (comma-separated value)--can be provided with a user exit.

You cannot modify the Protocol Processing step; however, you can add business logic to the step by adding handlers.

See Configuring fixed workflows for information about configuring this step.

You can use the default handler that applies to the protocol for your document, or you can specify a different handler for the Protocol Unpackaging and Protocol Processing fixed workflow steps.

Actions

The next step in the processing sequence occurs based on the actions that have been set up for the document exchange. Actions consist of a variable number of steps that can be performed on the document. Examples of actions are validation of a document (so that it conforms to a particular set of rules) and transformation of the document to the format required by the recipient.

If the document has no specific steps required, it can use the system-supplied Pass Through action, which makes no changes to the document.

Figure 12. Action steps
This figure shows how actions have a variable number of steps

You cannot modify a system-supplied action. You can, however, create an action (and add handlers to the configured list) or copy a system-supplied action and then modify the list of handlers.

See Configuring actions for information about creating or copying a system-supplied action or configuring a user-defined action.

Outbound fixed workflow

The Outbound Fixed Workflow consists of one step--the packaging of the document with its protocol information. For example, if a document has been set up to be received by a back-end application using Backend Integration packaging, certain header information is added to the document before it is passed to the gateway.

Figure 13. Outbound fixed workflow steps
This figure shows how a document flows through the Protocol Packaging step before being delivered

WebSphere Partner Gateway provides handlers for a variety of packages and protocols, as listed in Outbound workflow. If other packaging handlers are required, they can be developed as user exit steps. Typically these steps take care of one or more of the following processes:

You cannot modify the Protocol Packaging step; however, you can add business logic to the step by adding handlers.

See Configuring fixed workflows for information about configuring this workflow step.

Gateways

After the document leaves the Document Manager, it is sent, from the Gateway, to the intended recipient. The Gateway has two configuration points--Preprocess and Postprocess.

Figure 14. Gateway configuration points
This figure shows how a document flows through the Preprocess step before being delivered and that the Postprocess step is optionally used after the document is delivered

See Configuring handlers for information about configuring the Preprocess and Postprocess steps.

Copyright IBM Corp. 2003, 2005