XML
to EDI example
This section provides an example of the Community Manager
sending an XML document to the hub, where it is transformed into
an EDI transaction, enveloped within an EDI interchange, and sent
to a participant.
In this example, it is assumed that the Data Interchange Services
mapping specialist has created a transformation map that takes an
XML document and transforms it into a standard EDI 850 transaction
(defined with the MX12V3R1 dictionary) that will be processed by
the participant. In this example, the map is named S_DT_XML_TO_EDI.eif.
The Data Interchange Services mapping specialist can export the
transformation map directly to the WebSphere Partner Gateway database.
Alternatively, the Data Interchange Services mapping specialist
can send you the file, in which case you use the bcgDISImport utility
to import it into WebSphere Partner Gateway. This appendix assumes
the second scenario.
Importing the transformation map
This section describes the steps you take to import a
transformation map that will take XML input and transform it into
an EDI transaction. In the process of importing the transformation
map, you also import the document definition associated with the map.
Before you can import the transformation map, the Data Interchange
Services mapping specialist must send it to you. This set of steps
assumes that the file, S_DT_XML_TO_EDI.eif, is on your system.
- Open a command window.
- Enter the following command or script:
- On a UNIX system:
<ProductDir>/bin/bcgDISImport.sh <database_user_ID>
<password> S_DT_XML_TO_EDI.eif
- On a Windows system:
<ProductDir>\bin\bcgDISImport.bat <database_user_ID>
<password> S_DT_XML_TO_EDI.eif
where <database_user_ID> and <password> are
the values that you used when you installed the database as part
of the WebSphere Partner Gateway installation.
Verifying the transformation map and document flow definitions
To verify that the transformation maps and document definitions
you imported are available on the Community Console, perform the
following steps:
- Click Hub Admin > Hub Configuration > Maps > Transformation Maps.
The S_DT_XML_TO_EDI map is displayed.
- Click the View details icon next to the
map.
You see the document flow definitions with which this map is
associated:
Table 29. Document flow definitions associated with the map
Source |
Target |
Package: None
Protocol: FVT-XML-TEST (ALL)
Document Flow: ICGCPO (ALL) |
Package: N/A
Protocol: MX12V3R1 (ALL)
Document Flow: 850 (ALL) |
The S_DT_XML_TO_EDI map was defined to take an XML document and
transform it to an EDI transaction.
Configuring the target
In this section, you create a file-system directory target
for the hub:
- Click Hub Admin > Hub Configuration > Targets and
click Create Target.
- For Target Name, type: XMLFileTarget
- From the Transport list, select File Directory.
- For Root Path, type: /Data/Manager/xmltarget
- From the Configuration Point list, select Preprocess.
- Select com.ibm.bcg.edi.receiver.preprocesshandler.XMLSplitterHandler from the
Available List and click Add to move it to
the Configured List.
- Click Save.
The Community Manager sends the XML document to this target.
Creating the interactions
You create two interactions--one for the XML-to-EDI transformation and one for the EDI envelope.
Create an interaction that has a source that represents the XML document and a target that represents the transformed 850 transaction.
- Click Hub Admin > Hub Configuration > Document Flow Definition.
- Click Manage Interactions and then Create Interaction.
- Expand Package: None and Protocol: FVT-XML-TEST and
select Document Flow: ICGCPO.
- Expand Package: N/A and Protocol: MX12V3R1 and
select Document Flow: 850.
- From the Transformation Map list, select S_DT_XML_TO_EDI.
- From the Action list, select XML Translate and EDI Validate.
- Click Save.
This interaction represents the transformation of an XML document
into an EDI transaction and, therefore, you must select a transformation
map.
Create an interaction that represents the EDI envelope.
- Click Hub Admin > Hub Configuration > Document Flow Definition.
- Click Manage Interactions and then Create Interaction.
- Expand Package: N/A and Protocol: EDI-X12 and
select Document Flow: ISA.
- Expand Package: None and Protocol: EDI-X12 and
select Document Flow: ISA.
- From the Action list, select Pass Through.
Note: No transformation is occurring in this interaction.
- Click Save.
Creating the participants
For this example, you have two participants: the Community
Manager (Manager) and a participant (TP1).
Create the Community Manager profile:
- Click Account Admin > Profiles > Community Participant and
click Create.
- For Company Login Name, type: ComManager
- For Participant Display Name, type: Manager.
- For Participant Type, select Community Manager.
- Click New for Business ID and type 000000000 as the Freeform ID.
Note: Make sure you select Freeform and not DUNS.
- Click New for Business ID again and type 01-000000000 as the FreeForm ID.
- Click Save.
Create the second participant:
- Click Account Admin > Profiles > Community Participant and
click Create.
- For Company Login Name, type TP1
- For Participant Display Name, type TP1
- For Participant Type, select Participant.
- Click New for Business ID and type 000000001 as the Freeform ID.
Note: Make sure you select Freeform and not DUNS.
- Click New for Business ID again and type 01-000000001 as the Freeform ID.
- Click Save.
Creating the gateways
Create file-directory gateways for both participants in
the example. First, create a gateway for the Manager:
- Click Account Admin > Profiles > Community Participant and
click Search.
- Click the View details icon next to the
Manager profile.
- Click Gateways and then Create.
-
Enter the following values for the gateway.
Remember that the file directory (the entire path) must already
exist on your file system.
- For Name, type ManagerFileGateway.
- From the Transport List, select File Directory.
- For Address, type: file:///Data/Manager/filegateway
- Click Save.
- Click List to list all the gateways for
the Community Manager.
- Click View Default Gateways.
- From the Production list, select the gateway
you created in step 4.
- Click Save.
Next, create a gateway for the participant.
- Click Account Admin > Profiles > Community Participant and
click Search.
- Select the other participant you created for this example by
clicking on the View details icon next to TP1.
- Click on Gateways and then Create.
-
Enter the following values for the gateway.
Remember that the file directory (the entire path) must already
exist.
- For Name, type TP1FileGateway.
- From the Transport list, select File Directory.
- For Address, type: file:///Data/TP1/filegateway
- Click Save.
- Click List to list all the gateways for
the participant.
- Click View Default Gateways.
- From the Production list, select the gateway
you created in step 4.
- Click Save.
Setting up B2B capabilities
Enable the B2B capabilities of the two participants in
this exchange. In this example, the XML document is originating
from the Community Manager and will be delivered to the participant.
- Click Account Admin > Profiles > Community Participant and
click Search.
- Click the View details icon for the source
participant for this example (ComMan).
- Click B2B Capabilities.
- Enable three sets of capabilities for the source participant.
- Enable the document flow definition representing the XML document:
- Click the Role is not active icon under Set Source for Package: None to enable
it.
- Expand Package: None.
- Click the Role is not active icon under Set Source for Protocol: FVT-XML-TEST (ALL).
- Expand Protocol: FVT-XML-TEST (ALL).
- Click the Role is not active icon under Set Source for Document Flow: ICGCPO (ALL).
- Next, enable the document flow definition representing the transformed document:
- Click the Role is not active icon under Set Source for Package: N/A to enable
it.
- Expand Package: N/A.
- Click the Role is not active icon under Set Source for Protocol: MX12V3R1(ALL).
- Expand Protocol: MX12V3R1 (ALL).
- Click the Role is not active icon under Set Source for Document Flow: 850.
- Then, enable the document flow definition representing the EDI
envelope:
- Click the Role is not active icon under Set Source for Package: N/A to enable
it.
- Expand Package: N/A.
- Click the Role is not active icon under Set Source for Protocol EDI-X12 (ALL).
- Expand Protocol EDI-X12 (ALL).
- Click the Role is not active icon under Set Source for Document Flow: ISA (ALL).
- Click on Account Admin > Profiles > Community Participant and
click Search.
- Click the View details icon for the target
participant for this example (TP1).
- Click B2B Capabilities.
- Enable two sets of capabilities for the target participant.
- First, enable the document flow definition representing the
EDI 850 transaction:
- Click the Role is not active icon under Set Target for Package: N/A to enable
it.
- Expand Package: N/A.
- Click the Role is not active icon under Set Target for Protocol: MX12V3R1 (ALL).
- Expand Protocol: MX12V3R1 (ALL).
- Click the Role is not active icon under Set Target for Document Flow: 850 (ALL).
- Next, enable the document flow definition:
- Click the Role is not active icon under Set Target for Package: None to enable
it.
- Expand Package: None.
- Click the Role is not active icon under Set Target for Protocol: EDI-X12 (ALL).
- Expand Protocol: EDI-X12 (ALL).
- Click the Role is not active icon under Set Target for Document Flow: ISA(ALL).
Creating the envelope profile
You next create the profile for the envelope that will
contain the transformed 850 transaction.
- Click Hub Admin > Hub Configuration > EDI > Envelope Profile.
- Click Create.
- Type the name of the profile: EnvProf1.
- From the EDI Standard list, select X12.
- The General button is selected by default.
Type the following values for the general attributes of the envelope:
- INTCTLLEN: 9
- GRPCTLLEN: 9
- TRXCTLLEN: 9
- MAXDOCS: 1000
- Click the Interchange button and type
the following values for the interchange attributes:
- ISA01: 01
- ISA02: ISA0000002
- ISA03: 02
- ISA04: ISA0000004
- ISA11: U
- ISA12: 00301
- ISA15: T
- Click Save.
Creating the XML format
In this section, you create the custom XML format.
- Click Hub Admin > Hub Configuration > XML Formats.
- Click Create XML Format.
- For Routing Format, select FVT-XML-TEST ALL.
- For File Type, select XML.
- For Identifier Type, select Root Tag and
type MMDoc.
- For Source Business Id, select Constant and
type 000000000.
- For Target BusinessId, select Constant and
type 000000001.
- For Source Document Flow, select Constant and
type ICGCPO.
- For Source Document Flow Version, select Constant and
type ALL.
- Click Save.
Activating the connections
Activate the participant connections:
- Click Account Admin > Participant Connections.
- Select Manager from the Source list.
- Select TP1 from the Target list.
- Click Search.
- Click Activate for the following connection:
Table 30. XML document to EDI transaction connection
Source |
Target |
Package: None (N/A)
Protocol: FVT-XML-TEST (ALL)
Document Flow: ICGCPO (ALL) |
Package: N/A (N/A)
Protocol: MX12V3R1 (ALL)
Document Flow: 850 (ALL) |
- Click Activate for the connection that
represents the EDI envelope:
Table 31. EDI envelope connection
Source |
Target |
Package: N/A (N/A)
Protocol: EDI-X12 (ALL)
Document Flow: ISA (ALL) |
Package: None (N/A)
Protocol: EDI-X12 (ALL)
Document Flow: ISA (ALL) |
Configuring attributes
Configure the B2B Capabilities attributes of the target
participant (TP1) and the source participant (Manager):
- Click Account Admin > Profiles > Community Participant and
click on Search.
- Click the View details icon next to TPI to
select it.
- Click B2B Capabilities.
- Click the Expand icon next to Package: N/A.
- Click the Edit icon next to Protocol: MX12V3R1.
- Specify the following attributes:
- In the Envelope Profile row, select EnvProf1 from
the list.
- In the Interchange qualifier row, type 01.
- In the Interchange identifier row, type 000000001.
- In the Interchange usage indicator row, type T.
- Click Save.
- Click Account Admin > Profiles > Community Participant and
click on Search.
- Click the View details next to Manager to
select it.
- Click B2B Capabilities.
- Click the Expand icon next to Package: N/A.
- Click the Edit icon next to Protocol: MX12V3R1 (ALL).
- Specify the following attributes:
- In the Interchange qualifier row, type 01.
- In the Interchange identifier row, type 000000000.
- In the Interchange usage indicator row, type T.
- Click Save.
At this point, if the source participant (the Community Manager)
sent an XML document to the participant, it would be translated
(at the hub) to an EDI transaction, enveloped, and then sent to
the participant's gateway.
