Trading Networks 10.3 | Administering and Monitoring B2B Transactions | webMethods Module for EDI | Forming EDI Documents to Send Outbound When Using Trading Networks | Creating the Service to Form the EDI Document | Creating the Service
 
Creating the Service
 
Obtaining Control Numbers for Outbound Processing (ANSI X12 and UN/EDIFACT)
Adding TRADACOMS Envelopes and Obtaining Control Numbers
Note:
For ANSI X12 and UN/EDIFACT users: This section describes how to create a service to form an outbound EDI document when you are using standard processing. If you are using non-standard processing, see Creating the Service When Using Non-Standard Processing.
The following sample code illustrates how to form an ANSI X12 EDI document from an internal-format document when using Trading Networks with Module for EDI.
Flow operation
Description
1
Invoke the wm.b2b.edi:convertToValues service (or the wm.b2b.edi.tradacoms:convertToValues service for TRADACOMS documents) to convert the incoming internal-format document that is either a String or InputStream into an IData object. If you want, you can set the input parameters of the convertToValues service to have it validate the structure of the internal-format document.
The inputs to the convertToValues service include the internal-format document and the flat file schema that defines the structure for the internal-format document. For backward compatibility, you can use an IS document type to define the structure of an internal-format document rather than a flat file schema; however, it is recommended that you use flat file schemas. For more information about the convertToValues service, see webMethods Module for EDI Built-In Services Reference .
Note:
If the internal-format document is passed to your service as an IData object, you can still validate its structure before forming the EDI document. See Validating the Input Internal-Format Document When It Is an IData Object.
2
Map data from the internal-format document IData object into the EDI document IData object. Depending on the complexity of your mapping requirements, you might need to add more logic than a MAP flow operation or create a separate service to perform the mapping.
3
Invoke the wm.b2b.editn.TPA:getEDITPAData service to obtain the EDITPA data that contains delimiters and header information you can use for the outbound EDI document. For more information about the getEDITPAData service, see webMethods Module for EDI Built-In Services Reference .
4
Invoke the wm.b2b.edi:convertToString service (or the wm.b2b.edi.tradacoms:convertToString service for TRADACOMS) to convert the EDI document from an IData object to String format.
The inputs to the convertToString service include:
*The IData object that contains the data for your EDI document. Map this IData object to the values input parameter of the convertToString service.
*The flat file schema for the EDI document. The convertToString service uses the flat file schema to determine how to form the EDI document.
For backward compatibility, you can use an IS document type as input to the convertToString service rather than a flat file schema for files with delimited fields and records.
*The delimiters to use when creating the EDI document. Map the delimiters from the EDITPA to the inputs of the convertToString service:
5
Optionally, invoke the convertToValues service against the EDI document to validate the structure of your final EDI document.
The inputs to the convertToValues service include:
*The EDI document. The string output parameter from the convertToString service contains the EDI document. Map this to the edidata input parameter of the convertToValues service.
*The flat file schema that defines the structure for the EDI document.
6
Invoke the wm.b2b.edi.util:addICEnvelope service to add the interchange and group envelope to the EDI document. If you are creating a UN/EDIFACT EDI document, use the wm.b2b.edi.util:addICEnvelopeEDIFACT service. For more information, see Adding UN/EDIFACT Envelopes.
Note:
If you are creating a TRADACOMS EDI document, use the services in the wm.b2b.edi.tradacoms.compose folder to add a transmission envelope and a batch envelope (if specified) and to obtain control numbers. For more information, see Adding TRADACOMS Envelopes and Obtaining Control Numbers.
When setting the inputs to the addICEnvelope:
*Map the delimiters from the EDITPA to the inputs of the addICEnvelope service:
*Map the information from the EDITPA to the inputs of the addICEnvelope service:
* Set the ctlFromTable parameter to true to have the service obtain the control number. For more information, see Obtaining Control Numbers for Outbound Processing (ANSI X12 and UN/EDIFACT).
For information about delivering the document, see Delivering the Outbound EDI Document.