Typically the need to create and send an outbound transaction document to one of your trading partners is triggered by an event in your application such as the entry of a purchase order or the fulfillment of a sales order.
When such an event occurs, your application needs to notify the LANSA Composer transaction document processing framework such that LANSA Composer can subsequently generate and send the outbound document.
Your application can do this by registering a pending outbound transaction document. Subsequently, the outbound process detects and processes the pending outbound document.
There are three means provided for you to register a pending outbound transaction document, described under the following headings:
- Registering a pending outbound document using the TXDOC_REGOUTBND activity
- Registering a pending outbound document using the LANSA function API
- Registering a pending outbound document using the LANSA component API
For a more general API that is capable of registering both inbound AND outbound documents, you may wish to refer also to:
Registering a pending outbound document using the TXDOC_REGOUTBND activity
The simplest case is where you have an existing LANSA Composer Processing Sequence which is responsible for the event that triggers the need to generate and send an outbound transaction document. In that event, your process can include the supplied TXDOC_REGOUTBND activity to register the pending outbound transaction document and no programming is required.
For more information on this activity, refer to TXDOC_REGOUTBND.
Registering a pending outbound document using the LANSA function API
LANSA Composer provides the DXXREGO function for registering a pending outbound transaction document from a LANSA application.
- Your LANSA application can call DXXREGO using the CALL RDML command with PROCESS(*DIRECT). Function DXXREGO must execute on the LANSA Composer server. Your application may, however, execute it via the LANSA SuperServer CALL_SERVER_FUNCTION built-in function.
- Your application can pass the necessary variable information using the LANSA exchange list as follows:
Name | Description | Type |
|---|---|---|
DXTPII | Trading partner internal or external id | A(32) |
Either | Document type name Document standard internal identifier |
A(32) |
DXXTRNTYP | Transaction id (eg: '850', 'INVOIC') | A(6) |
DXXTEST | Production (P) or test (T) indicator | A(1) |
DXXKEY01 | Staging file key 1 (eg: Company code) | A(32) |
DXXKEY02 | Staging file key 2 (eg: Division code) | A(32) |
DXXKEY03 | Staging file key 3 (eg: Department code) | A(32) |
DXXKEY04 | Staging file key 4 (eg: Invoice number) | A(32) |
DXXKEY05 | Staging file key 5 (eg: other) | A(32) |
DXXKEY06 | Staging file key 6 (eg: other) | A(32) |
- Your application can receive the result of the request via the exchange list as follows:
Name | Description | Type |
|---|---|---|
DXRESULT | Result code (OK, ER) | A(2) |
DXXENVID | Transaction document envelope id | S(9, 0) |
Registering a pending outbound document using the LANSA component API
Note: This section assumes sound knowledge of the applicable LANSA development techniques. Refer to LANSA product documentation for detailed information on application development with LANSA.
LANSA Composer provides the DXXREGOUT re-useable part that provides several interfaces for registering a pending outbound transaction document from a component-based LANSA application.
The application can choose from two interfaces:
1. Method dxSimpleDocument allows the application to create and register a single document envelope containing a single interchange, group, and transaction message in one call
2. An alternate set of methods allows the application to create and register a more complex transaction document containing multiple interchanges, groups and/or transaction messages:
dxNewDocument1 OR dxNewDocument2
dxNewInterchange (optional)
dxNewGroup (optional)
dxNewMessage
dxRegisterDocument
When using either interface style, the application can optionally handle the following events:
dxValidationError
dxPreInsert2IN
dxPreInsert3GP
dxPreInsert4MS
The latter three events offer an opportunity to customize the transaction data generated by the API before it is written to the transaction document database.
Note: Once you have imported the LANSA Composer development package into your Visual LANSA development environment, you can use the feature help within the Visual LANSA IDE to review the detail of the methods and events exposed by the DXXREGOUT component.