Routing EDI Documents In and Out of IBM webMethods B2B
Summary
You can create an integration in IBM® webMethods Integration Flow services by using the receiveEDI850Send855B2BTransactions recipe. The recipe receives an EDI purchase order (X12 4010 850) document from a trading partner from IBM webMethods B2B, and sends an EDI purchase order acknowledgment (X12 4010 855) back to the trading partner through IBM webMethods B2B.
The receiveEDI850Send855B2BTransactions recipe uses the predefined operations defined in the IBM webMethods B2B and Electronic Data Interchange applications on IBM webMethods Integration Flow services to help you create a business integration. The integration input pipeline for this recipe is pre-loaded with the input signature required to interpret a transaction payload coming from a IBM webMethods B2B product instance and the output pipeline is constructed with the signature that the IBM webMethods B2B product instance understands.
In this use case, an FTP back-end system generates the purchase order and a custom purchase order XML is used to depict the mapping in the input and output pipelines.
The use case starts when an inbound purchase order (X12 4010 850) document arrives in IBM webMethods B2B from a trading partner and the corresponding integration is invoked through a processing rule. The use case ends when the trading partner receives the EDI purchase order acknowledgment (X12 4010 855) document for the purchase order it sent initially.
You can view the purchase order receipt and purchase order acknowledgment transactions in the Transactions page of IBM webMethods B2B.
Business Document Flow
User Roles and Privileges
- IBM webMethods Integration instance with administrator privileges.
Before You Begin
-
You must have a basic understanding of IBM webMethods B2B and its related components like the user interface.
-
You must have a basic understanding of IBM webMethods Integration Flow services and knowledge of creating integrations using various applications.
-
You must have a fully functional IBM webMethods B2B product instance with the required B2B assets such as channels, partner profiles, business documents, and processing rules.
-
You must have an X12 4010 850 (purchase order) coming in from a trading partner to perform the orchestration.
-
Set up the appropriate inbound and outbound AS2 channels to send and receive documents from trading partners in IBM webMethods B2B. And remember to share the inbound AS2 endpoint URL with your trading partners so they can send documents to IBM webMethods B2B.
For more information, see the IBM webMethods B2B Help.
-
Ensure that the rest endpoint URL is a valid IBM webMethods Flow services orchestration URL when the processing rule calls the integration from a IBM webMethods B2B product instance.
If you want to track the status of the integration execution as a task, use the Reliable execution mode while calling an integration. When you use this mode, IBM webMethods B2B creates a task to track the status of the integration execution. You can monitor the task status on the Tasks page for a transaction.
Routing a Business Document To and From a Trading Partner
-
On the IBM webMethods Integration product instance, go to Recipes.
-
Go to Flow services, and type B2B in the search box to see the receiveEDI850Send855B2BTransactions recipe, click Use.
-
Select a project and the application account to connect to the IBM webMethods B2B product instance, along with FTP account details, and click Next.
-
Type a name for your integration along with a description, and click Finish.
The following image shows the recipe flow:
Step 1: Parse the content received from IBM webMethods B2B product instance and generate the required output
In the IBM webMethods B2B application, click
and select the appropriate account details for the parseContent
predefined operation.
Ensure that the content field of the Pipeline Input is mapped with the inputContent of the parseContentInput.
Step 2: Extract the interchange control and group headers from the 850 EDI message
Click and select Map Input
and Output of the processEnvelope operation. Ensure that the outputContent is
mapped to the ediMessage.
Step 3: Convert the X12 4010 850 EDI message to the native document type on IBM webMethods Integration
In the Pipeline Input, ediMessage is automatically mapped to the ediMessage of the convertEDIMessageToDocument Input.
Step 4: Transform the pipeline to map X12 4010 850 Purchase Order to a compatible format
In the following example, the X12 4010 850 purchase order is mapped with a purchase order in XML format.
Step 5: Convert the X12 4010 850 Purchase Order XML to XML stream
The X12 4010 850 Purchase Order XML in the Pipeline Input is mapped to the documentToXMLStream Input.
Step 6: Send the XML stream to the back-end system
In this example, the orchestration uses an FTP server as the back-end system.
In the Pipeline Input, map the xmlStream to the contentStream of the putFile Input.
Step 7: Transform the pipeline by mapping the XML stream
In the Pipeline Input, map the appropriate custom document fields to the sender and receiver fields in the Pipeline Output.
Step 8: Simulate the generation of the Purchase Order Acknowledgment and convert it to an XML stream
Generate the purchase order acknowledgment in your back-end system and convert it to an XML stream.
Step 9: Write custom logic to send the generated Purchase Order XML to the FTP server (back-end system)
In this example, inputStream of the Pipeline Input is mapped to the outputStream of the putFile Input of the FTP server.
Step 10: Retrieve the Purchase Order Acknowledgment XML from the FTP Server (back-end system)
In this example, remoteFile of the Pipeline Input is mapped to the remoteFile of the getFile Input.
Step 11: Convert the X12 4010 855 Purchase Order Acknowledgment from XML stream to string
Convert the purchase order acknowledgment in your back-end system from a stream to a string.
Step 12: Transform the pipeline by adding a variable
Add itemsAck variable to the Pipeline Output.
The xmlStringToDocument service specifies the need to add this variable to the pipeline output.
Step 13: Convert the Purchase Order Acknowledgment string to a native Purchase Order Acknowledgment on IBM webMethods Integration
Map the appropriate fields from the Pipeline Input to the xmlStringToDocument Input .
Step 14: Map the Purchase Order Acknowledgment to a native EDI X12 4010 855 document on IBM webMethods Integration
Map the appropriate fields from the Pipeline Input to the convertDocumentToEDIMessage Input.
Step 15: Add a group envelope to the generated EDI X12 4010 855 message
Map the appropriate fields from the Pipeline Input to theaddGroupEnvelope Input .
Step 16: Add an interchange control envelope
Map the appropriate fields from the Pipeline Input to theaddInterchangeEnvelope Input .
Step 17: Send the EDI X12 4010 855 Purchase Order Acknowledgment response to IBM webMethods B2B
Map the appropriate fields from the Pipeline Input to the sendtoB2B Input. The submit operation sends the document back to the IBM webMethods B2B instance in a signature that it can interpret.
Step 18: Clear the pipeline data
Select the variables in the Pipeline Input, click
> and click Finish.
Step 19: Return an appropriate error message if the integration execution fails
If the integration execution fails, return an appropriate message to the processing rule integration call you made initially. The message is either displayed on the Course of transaction, or is tracked as a task for a transaction if you have used the reliable execution mode.
Error Scenarios You Might Encounter
- Ensure that the variables you add to transform the pipeline, have the appropriate data type to avoid errors.
Next Steps
For the successful completion of the use case, ensure the following:
- All the B2B assets you create on IBM webMethods Integration and IBM webMethods B2B must be in enabled state.