Writing a Custom Business Agent

Business agents are written in standard Java language, and can use any available Java libraries or services. The business agent must import the edaqm package (com.ibi.edaqm.*), and must extend com.ibi.edaqm.XDAgent. Two forms of business agents are supported, standard business agents and acknowledgement business agents. Acknowledgement business agents differ from standard business agents in that they:

Acknowledgement business agents are scheduled to emit acknowledgements such as an EDI 997, while standard business agents are scheduled to process documents and implement appropriate business logic.

The XDAgent parent class provides the business agent with services.

Your business agent makes use of the iWay Service Manager objects, which are described in Programming Objects.

Upon entry, the process() method of the business agent receives two XDDocuments, an input document and an output document. Documents carry trees of XDNodes, and can be navigated, constructed, and modified by appropriate method calls. When the business agent completes, the tree in the output document is flattened into an XML document and sent on to the ultimate recipient(s). Documents can also carry flat messages. Such exits only operate on messages if the "Accepts flat" property is configured for the listener.

The business agent can elect to join a transaction in progress. Doing so requires that the business agent register a class meeting the XDTx interface, supporting the commit(), rollback(), and prepare() methods.

To program business agents, the following .JAR files must be added to the classpath if you are using Eclipse or a similar IDE:


iWay Software