Implementing EDI with WebSphere Partner Gateway V6.2, Part 2

This article series explains Electronic Data Interchange (EDI) transformations using WebSphere Partner Gateway V6.2. Part 2 shows you how to implement two different de-enveloping and EDI transformation operations -- EDI to XML transformation, and EDI to record-oriented data (ROD) transformation.

Sonali Samantaray (sonali.samantaray@in.ibm.com), Software Engineer, IBM

Photo of Sonali SamantaraySonali Samantaray is a Software Engineer on the WebSphere Partner Gateway team at the IBM India Software Lab. She has a Masters Degree in Computer Applications and is an IBM Certified DB2 Associate and IBM Certified SOA Associate. Sonali has published technical documents for various symposiums as well as several IBM developerWorks articles. You can contact Sonali at sonali.samantaray@in.ibm.com.



12 May 2010

Also available in Chinese

Introduction

The article describes two scenarios of transformation and enveloping in IBM® WebSphere® Partner Gateway V6.2. In Scenario 1, WebSphere Partner Gateway receives XML documents from an internal or external partner, transforms them into EDI transactions, envelops the transactions, and sends them to the internal or external partner. In Scenario 2, WebSphere Partner Gateway receives record-oriented data (ROD) documents from an internal or external partner, transforms the documents into EDI transactions, envelops the transactions, and sends them to the internal or external partner. (ROD documents are documents that conform to a proprietary format.)

De-enveloping refers to unpacking a single EDI document into its multiple component EDI business documents, called transactions. In the EDIFACT standard, these are called messages. Each transaction or message flows through the document manager as individual business document flows. De-enveloping is not the same as splitting. Splitting applies when multiple EDI documents are placed together in a file, and the documents may not have any relationship with one another. The EDI de-enveloper extracts the Enveloper level, Group level and Transaction level information.

Prerequisites

  • WebSphere Partner Gateway V6.2 should be installed and running
  • Download samples.zip at the bottom of the article and extract it to a folder. It contains samples of maps and input files.

Scenario 1. EDI to XML document flow

In Scenario 1, an incoming EDI X12 ISA from the source trading partner passes through a hub where the EDI is translated into XML, and the output XML is then sent to the target trading partner. The map is EDI-XMLcompiled.eif, and the input file is EDI_855_XMLInput.edi:

Figure 1. EDI to XML document flow
EDI to XML document flow

Step 1. Importing the map

  1. Log into the WebSphere Partner Gateway community console.
  2. Navigate to Wizards => EIF Import Wizard.
  3. Click Browse and select EDI-XMLcompiled.eif from the file system.
  4. Click Import:
    Figure 2. Importing a map using the EIF Import Wizard
    Importing a map using the EIF Import Wizard
  5. The next screen opens:
    Figure 3. Import summary screen
    Import summary screen
  6. Click Next to view the transaction that is created with this map import:
    Figure 4. Default interaction created
    Default interaction created
  7. Click Next and then Finish:
    Figure 5. Import completion screen
    Import completion screen

Step 2. Verifying the map import

  1. Navigate to Hub Admin => Hub Configuration => Maps => Transformation maps. The transformation map EDI_XML_PO-ACK should be listed.
  2. Click on the View details icon to check the document definition at the source and target side.
    Figure 6. Document definition from source to target
    Document definition from source to target

Step 3. Creating Receiver

  1. Navigate to Hub Admin => Receivers.
  2. Click Create Receiver.
  3. Specify the name of the Receiver. For example: FileReceiver
  4. Select Transport as the File directory
  5. Specify the Document Root Path. For example: /FileReceiver.
  6. Click Save. EDI Splitter is required only if an input document with multiple EDI ISA is expected.

Step 4. Creating Partners

  1. Create an Internal Partner with name Manager and DUNS id 123123123.
  2. Create an External Partner with name Partner and DUNS id 321321321.
  3. Edit the input file EDI_855_XMLInput.edi to modify the Sender and Receiver IDs, as shown below:
    Figure 7. Modifying Sender and Receiver IDs in input XML file
    Sender ID and Receiver ID

Step 5. Creating Destinations

  1. Create Destinations for both Manager and Partner by selecting File Directory as the transport.

Step 6. Creating Interactions

  1. For the EDI to XML Scenario, create two interactions: one corresponding to the de-envelope, and one corresponding to the transformation of the resultant de-enveloped message to XML.
  2. The interaction for validation and translation was already created while importing the map.
  3. Navigate to Hub Admin => Document Definition => Create interaction.
  4. Select the following items to create an interaction for the de-enveloping:
    • Source Package: N/A, Protocol: EDI-X12(ALL), Document Flow: ISA(ALL)
    • Target Package: None, Protocol:EDI-X12(ALL), Document Flow:ISA (ALL)
    • Action EDI De-envelope

Step 7. Enabling B2B capabilities for Partners

  1. Enable the following Package, Protocol, and Document Flow for Manager (Internal Partner)
    • Package: None, Protocol: EDI-X12 (ALL), Document Flow: ISA (ALL)
    • Package: N/A (N/A), Protocol: X12V4R1 (ALL), Document Flow: 855 (ALL)
  2. Enable the following Package, Protocol, and Document Flow for Partner (External Partner):
    • Package: N/A, Protocol: EDI-X12 (ALL), Document Flow: ISA (ALL)
    • Package: None (N/A), Protocol: CUSTOM_XML(ALL), Document Flow: PURCHASE_ORDER_ACK(ALL)

Step 8. Enabling connections

  1. Navigate to Account Admin => Connections.
  2. Select Manager from Source drop down.
  3. Select Partner from Target drop down.
  4. The connections should be activated as shown below:
    Figure 8. Enabling Partner connections
    Enabling Partner connections

Step 9. Allow elements with duplicate IDs

Each enveloped EDI document has a control number associated with it as part of the ISA segment. The control number uniquely identifies the incoming document. In order to use the same input document more than once, you need to tell WebSphere Partner Gateway to allow duplicate control numbers -- otherwise, it will not process the document and will throw a duplicate interchange error:

  1. Navigate to Hub Admin => Hub Configuration => Document Definition.
  2. Click on the collapsed node icon next to Package: None. A list of all available protocols opens.
  3. Click on edit attributes icon next to Protocol: EDI-X12 (ALL).
  4. Locate the Allow documents with duplicate document ids attribute listed under the Document Flow Context Attributes and select Yes from the drop-down menu.
  5. Click Save.

Step 10. Running the scenario

  1. Copy the input file EDI_855_XMLInput.edi to the FileReceiver/Documents/Production folder.
  2. Navigate to Viewers => Document Viewer to check the document status. The EDI document should be de-enveloped and translated to XML.
  3. The XML document is sent to the Partner destination.
  4. The output transactions are shown below:
    Figure 9. Transactions in the Document Viewer
    Transactions in the Document Viewer

Scenario 2. EDI to ROD document flow

In Scenario 2, an incoming EDI X12 ISA from the source trading partner passes through the hub, where the EDI is translated to ROD, and then sent to the target trading partner. The map is compiledEDI_ROD.eif and the input file is edi2adf.inp:

Figure 10. EDI to ROD document flow
EDI to ROD document flow

Step 1. Importing the map

  1. Import the map compiledEDI_ROD.eif using the EIF Import Wizard, as described above in Scenario 1, Step 1:
    Figure11. Map import completion screen
    Map import completion screen

Step 2. Verifying the map import

See Scenario 1, Step 2 to verify that S-DT-EDI-TO-ADF is listed and that the document definition is created.

Step 3. Creating Receiver

  1. Navigate to Hub Admin => Receivers.
  2. Click on Create Receiver.
  3. Specify the name of the Receiver. For example: EDItoRODFileReceiver.
  4. Select Transport as File Directory.
  5. Specify the Document Root Path. For example: /EDItoRODFileReceiver.
  6. Click Save on the Receiver Creation page.

Step 4. Creating Partners

The Partners created in Scenario 1, Step 4 can be reused for this scenario, or new participants can be created. For simplicity, reuse the Partners created in Scenario 1. Edit the input file edi2adf.inp to modify the Sender and Receiver IDs as shown in Scenario 1, Figure 7.

Step 4. Creating Destinations

Create Destinations for both Manager and Partner by selecting File Directory as the transport. The destinations created in Scenario 1 can be reused for this step.

Step 5. Creating Interactions

For the EDI to ROD Scenario, create two interactions: one corresponding to the de-envelope, and one corresponding to the transformation of the resultant de-enveloped message to ROD. The first interaction is already created in Scenario 1 Step 6. The second interaction gets created when the transformation map is imported.

Step 6. Enabling B2B capabilities for the Partners

  1. Enable the following Package, Protocol, and Document Flow for Manager (Internal Partner):
    • Package: None, Protocol: EDI-X12 (ALL), Document Flow: ISA (ALL)
    • Package: N/A, Protocol: X12V2R1 (ALL), Document Flow: 850 (ALL)
  2. Enable the following Package, Protocol, and Document Flow for Partner (External Partner):
    • Package: N/A, Protocol: EDI-X12 (ALL), Document Flow: ISA (ALL)
    • Package: None, Protocol: DEMO850CL_DICTIONARY (ALL), Document Flow: DEMO850CLSUW (ALL)

Step 7. Enabling connections

  1. Navigate to Account Admin => Connections.
  2. Select Manager from the Source drop-down.
  3. Select Partner from the Target drop-down.
  4. Activate the connections as shown below:
    Figure 12. Activate partner connections
    Activate partner connections

Step 8. Allow elements with duplicate IDs

This configuration was done in Scenario 1, Step 9 .

Step 9. Running the scenario

  1. Copy the input file edi2adf.inp to the EDItoRODFileReceiver/Documents/Production folder.
  2. Navigate to Viewers => Document Viewer to check the document status. The EDI document should be de-enveloped and translated to ROD.
  3. The ROD document is then sent to the Partner's destination. The output transactions are shown below:
    Figure 13. Transactions in Document Viewer
    Transactions in Document Viewer

Conclusion

This article demonstrated two scenarios for de-enveloping and transformation in WebSphere Partner Gateway V6.2 -- EDI to XML transformation, and EDI to ROD transformation.


Download

DescriptionNameSize
Code samplesamples.zip17 KB

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Business process management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere, Industries
ArticleID=489514
ArticleTitle=Implementing EDI with WebSphere Partner Gateway V6.2, Part 2
publish-date=05122010