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

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



14 April 2010

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.)

WebSphere Partner Gateway supports the transformation, enveloping, and de-enveloping with the following EDI standards:

X12
Common EDI standard approved by the American National Standards Institute (ANSI)
UN/EDIFACT
United Nations Electronic Data Interchange for Administration Commerce and Support
UCS
Uniform Communication Standard

An EDI interchange envelope is a series of segments. EDI interchanges can contain three levels of segments, each with a header segment at the beginning and a trailer segment at the end:

Transaction envelope
A series of detailed segments that defines a transaction
Group envelope
A group of transactions of the same type
Interchange envelope
A number of groups destined for a particular trading partner

Each EDI standard provides its own method and its own segments for displaying the data within an interchange, as shown in the table below:

Table 1. Segment names for each EDI standard
EDI standardInterchange startInterchange endGroup startGroup endTransaction startTransaction end
EDI-X12ISAIEAGSGESTSE
EDIFACTUNBUNZUNGUNEUNHUNT
UCSBGEGGSGESTSE

EDI is a method used for transmitting business information over a network between business associates who agree to follow industry standards for translating or exchanging information. Maps are required to perform the translation tasks. This article shows you how to use transformation maps to transform a document from one format to another.

Maps can be created using the Data Interchange Services (DIS) client.

Prerequisites

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

Scenario 1. XML to EDI document flow

This scenario involves translating an incoming XML file into an EDI transaction based on the mapping, enveloping the transaction in an EDI X12 ISA, and sending the output EDI to the target partner. Use the map compiledSDT-XML-EDI.eif and the input file Splitterxml2edi.xml.

Figure 1. XML to EDI document flow
XML to EDI 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 compiledSDT-XML-EDI.eif from the file system.
  4. Click Import:
    Figure 2. Importing a map using EIF Import Wizard
    Importing a map using EIF Import Wizard
    After clicking Import, the next screen opens:
    Figure 3. Import summary screen
    Import summary screen
  5. Click Next to view the transaction that gets created with this map import:
    Figure 4. Default Interaction created
    Default Interaction created
  6. 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 S-DT-XML-TO-EDI should be listed.
  2. Click the View details icon to check the document definition at 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, such as XMLtoEDIFileReceiver.
  4. For File directory, select Transport.
  5. Specify the Document root path, such as /XMLtoEDIFileReceiver.
  6. In the Handlers section, select Pre-process from the drop-down for Configuration point handlers.
  7. Select com.ibm.bcg.edi.receiver.preprocesshandler.XMLSplitterHandler from the Available list and add it to the Configured list.
  8. Click Save.

You can use this receiver for an EDI file containing multiple EDI envelopers. The XML splitter parses the document and creates the metadata that will be used by the document manager to extract the routing trading partner information.

Step 4. Creating partners

  1. Create an Internal partner with name Manager and Freeform id 01-111111111.
  2. Create an External partner with name Partner and Freeform id 01-222222222.
  3. Edit the input file Splitterxml2edi.xml to modify the Sender ID and Receiver ID as shown in below:
    Figure 7. Modifying Sender and Receiver IDs in the input XML file
    Modifying Sender and Receiver IDs in the input XML file

Step 5. Creating destinations

  1. Create destinations for both manager and partner by selecting File directory as the transport.

Step 6. Creating interactions

  1. Two interactions need to be configured for this flow -- one for the translation and enveloping, and another for the EDI document to be sent to the target destination.
  2. The transformation interaction was already created while importing the map. The XML document gets translated into EDI transactions through the "XML translate and Validate" action. The output transaction needs to be enveloped. Here, an envelope profile is used to define the envelope properties.
  3. Navigate to Hub Admin => Document Definition => Create interaction.
  4. Specify the following items to create an interaction to send the enveloped EDI message to the target destination:
    • Source
    • Package: N/A
    • Protocol: EDI-X12 (ALL)
    • Document flow: ISA (ALL)
    • Target:
    • Package: None
    • Protocol: EDI-X12 (ALL)
    • Document flow: ISA (ALL)
    • Action: Pass through

Step 7. Enabling B2B capabilities for the partners

  1. Enable the following Package, Protocol, and Document flow for Manager (Internal Partner):
    • Package: None
    • Protocol: FVT-XML-TEST (ALL)
    • Document flow: ICGCPO (ALL)
    • Package: N/A
    • Protocol: EDI-X12 (ALL)
    • Document flow: ISA (ALL)
    • Package: N/A
    • Protocol: MX12V3R1 (ALL)
    • Document flow: 850 (ALL)
  2. Enable the following Package, Protocol, and Document flow for Partner (External Partner):
    • Package: N/A
    • Protocol: Protocol: MX12V3R1 (ALL)
    • Document flow: 850 (ALL)
    • Package: None
    • Protocol: EDI-X12 (ALL)
    • Document flow: ISA (ALL)

Step 8. Creating envelope profile

  1. Navigate to Hub Admin => Hub Configuration => Envelope Profile.
  2. Click Create.
  3. Provide a name for the Envelope profile, such as EnvProfile.
  4. Select X12 as the EDI Standard.
  5. Click Save.
    Figure 8. Creating Enveloper profile
    Enveloper Profile

Step 9:Creating XML format

XML to EDI flow requires the XML format to be defined to determine the format of the XML to extract the attributes like Sender ID and Receiver ID.

  1. Navigate to Hub Admin => XML Formats.
  2. Click Create Document Family.
  3. Specify the Family name, such as DocFamily.
  4. Select the protocol FVT-XML-TEST ALL from the drop-down list.
  5. Select Family type as Root Tag.
  6. Provide MMDoc as the Family identifier.
  7. Click Save.
  8. Click Create XML Format.
  9. Provide the values as shown in Figures 9 and 10:
  10. Click Save:
    Figure 9. Document definition type criteria
    Document definition type criteria
    Figure 10. Document attributes
    Document attributes

Step 11. 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 11. Enabling partner connections
    Enabling partner connections

Step 12. Configuring connection attributes on target partner

For the Receiver ID: At the target partner of the EDI flow -- attributes at the participant connection for the target partner is used.

  1. Click Attributes for Target side in the connection for Protocol MX12V3R1.
  2. In the connection summary page, click Protocol.
  3. Locate the Envelope profile attribute and select EnvProfile from the dropdown.
  4. Locate the Business identifier (EDI Interchange Qualifier) and provide the value 01.
  5. Locate the Business identifier (EDI Interchange Identifier) and provide the value 222222222.
  6. Locate the Interchange usage indicator and provide the value T.
  7. Click Save.

Step 13. Configuring B2B capabilities attributes on source partner (Manager)

For the Sender ID: At the source partner of the EDI flow -- the attributes at the participant connection for the source partner is not for the generated EDI envelope -- therefore the source ID is specified at the source trading partner's B2B capabilities.

  1. Navigate to Manager's B2B capabilities.
  2. Click edit icon for MX12V3R1 protocol.
  3. Locate the Envelope Profile attribute and select EnvProfile from the dropdown.
  4. Locate the Business Identifier (EDI Interchange Qualifier) and provide the value 01.
  5. Locate the Business Identifier (EDI Interchange Identifier) and provide the value 111111111.
  6. Locate the Interchange usage indicator and provide the value T.
  7. Click Save.

Step 14. Running the scenario

  1. Copy the input file Splitterxml2edi.xml to the XMLtoEDIFileReceiver/Documents/Production folder.
  2. Navigate to Viewers => Document Viewer to check the document status.
  3. The XML should be should be translated to 850 transaction.
  4. The enveloped document is send to the Partner's file destination.
  5. The output transactions are shown below:
    Figure 12. Transactions in the Document viewer
    Transactions in the Document viewer

Scenario 2. ROD to EDI document flow

This scenario involves an incoming ROD document to be translated to an EDI transaction based on the mapping, and then the transaction to be enveloped in an EDIX12 ISA. The output EDI is then sent to the target partner.

Figure 13. ROD to EDI document flow
ROD to EDI document flow

Map to be used: compliledADF-EDI.eif, Input file: adf2edi.inp

Step 1. Importing the map

Import compliledADF-EDI.eif map using the EIF Import wizard following the procedure in Step 1 of Scenario 1.

Figure14. Map Import Completion Screen
Map Import Completion Screen

Step 2. Checking the map import

Refer to the procedure described in Step 2 of Scenario 1 to verify that compliledADF-EDI.eif is listed and the document definition is created.

Step 3. Creating receiver

  1. Navigate to Hub Admin => Receivers.
  2. Click Create Receiver.
  3. Specify the name of the Receiver, such as RODtoEDIFileReceiver.
  4. Select Transport as File directory.
  5. Specify the Document Root Path, such as /RODtoEDIFileReceiver.
  6. Select Pre-process from the drop down for Configuration Point Handlers in the Handlers section.
  7. Select com.ibm.bcg.edi.receiver.preprocesshandler.RODSplitterHandler from Available list and add to the Configured list.
  8. Select com.ibm.bcg.edi.receiver.preprocesshandler.RODSplitterHandler handler in the Configured list and Click Configure.
  9. Provide the values as shown in Figure 15 below and Click SetValues.
  10. Click Save in the receiver creation page.
    Figure 15. Configuring the ROD Splitter Handler
    Configuring the ROD Splitter Handler

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, this article reuses the partners created in Scenario 1. Edit the input file adf2edi.inp to modify the Sender and Receiver IDs as shown below:

Figure 16. Modifying the Sender ID Receiver IDs in the input ROD file
Modifying the Sender ID Receiver IDs in the input ROD file

Step 5. 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 6. Creating interactions

For the ROD to EDI Scenario, two interactions need to be created. One interaction transforms the ROD to EDI 850 message and envelopes it, and the second one corresponds to sending the enveloped EDI message to the Target Partner. The first interaction gets created when the transformation map is imported. The second interaction is already created in Step 6 of Scenario 1.

Step 7. Enabling B2B capabilities for the partners

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

Step 8. Create envelope profile

The envelope profile EnvProfile created in Scenario 1 can be reused.

Step 9. 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 17. Activating partner connections
    Partner connections

Step 10. Configuring the attributes

For the EDI 850 message to be enveloped, you must configure some attributes, as described below:

  1. Navigate to Account admin => Search => Partner (Target Partner) => B2B Capabilities.
  2. Expand Package N/A.
  3. Click edit icon next to Protocol : X12V2R1 (ALL).
  4. Locate the Envelope Profile> attribute and select EnvProfile from the dropdown.
  5. Locate the Business Identifier (EDI Interchange Qualifier) and provide the value 01.
  6. Locate the Business Identifier (EDI Interchange Identifier) and provide the value 111111111.
  7. Locate the Interchange usage indicator and provide the value T.
  8. Click the Validation tab.
  9. Locate the attributes Max validation error level and Validation level. Select 2 from the drop-down for both of these attributes.
  10. Click Save.

Step 11. Running the scenario

  1. Copy the input file adf2edi.inp to the RODtoEDIFileReceiver/Documents/Production folder.
  2. Navigate to Viewers => Document Viewer to check the document status. The ROD should be should be translated to 850 transaction.
  3. The enveloped document is send to the Partner's file destination. The output transactions are shown below:
    Figure 18. Transactions in Document Viewer
    Transactions in Document Viewer

Conclusion

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


Download

DescriptionNameSize
Code samplesamples.zip.zip16 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=482496
ArticleTitle=Implementing EDI with WebSphere Partner Gateway V6.2, Part 1
publish-date=04142010