Running the EDIFACT sample
This topic explains how to put the test messages through the EDIFACT message flow.
The input messages
The EDIFACT sample contains the following five test messages:
- D.96A_INVOICE_1.mbtest
- D.96A_INVOICE_2.mbtest
- D.96A_INVOICE_3.mbtest
- D.96A_INVOICE_4.mbtest
- D.96A_INVOICE_missing_BGM.mbtest
All five input messages are INVOICE messages. The first four input messages are valid.
The fifth input message is not valid: the BGM field is missing from the message.
Running the sample
To run the sample, you must put messages on the input queues, and get messages from the
output queues. You can use the Dequeue section of the Test Client to retrieve the messages
from the output queues. If the message is not on the output queue you expect, change the
name of the output queue to the name of the failure queue. Follow the instructions below
to run the sample:
- Put one of the input messages on the EDIFACT_TO_XML_IN queue:
- In the Broker Development view, expand the EDIFACT Message Flows project.
Double-click one of the
.mbtest files to open it in the Test Client.
- In the Test Client, click Send Message. The message
in the .mbtest file is written to the queue.
When you put a message on the EDIFACT_TO_XML_IN queue, the EDIFACT_TO_XML_IN MQInput
node in the first message flow (called VALIDATINGEDIFACT2XML.msgflow), parses the message
and validates it against the message set:
- If the message is a valid EDIFACT message, it is passed to the Compute node,
which converts the EDIFACT message to an XML message. The Compute node then passes
the message to the EDIFACT_TO_XML_OUT MQOutput node, which puts the message on the
EDIFACT_TO_XML_OUT queue.
- If the message is not a valid EDIFACT message, the message is passed to the
EDIFACT_FAIL node, which puts the message on the EDIFACT_FAIL queue.
- Get the transformed message from the EDIFACT_TO_XML_OUT queue using Dequeue:
- In the Test Client, click Dequeue.
- Click Get Message to read a
message from the EDIFACT_TO_XML_OUT queue. The transformed
message is now in XML format.
- Ensure that Source is selected
under Detailed Properties. Right-click
the contents of the message in the Source pane, and click Select All.
- To take a copy of the message, right-click the contents of the message in the
Source pane and click Copy.
- Put your copied message from step 2 onto the XML_TO_EDIFACT_IN queue by using the Test Client.
- In the Test Client, click Enqueue.
- In the Source pane, right-click the Source message and click
Select All. Then right-click and select
Paste, to replace the existing source message.
- In the Queue name field, type XML_TO_EDIFACT_IN.
- Click Send Message to put the copied message onto the
XML_TO_EDIFACT_IN queue.
When you put the message onto the XML_TO_EDIFACT_IN queue, the XML_TO_EDIFACT_IN MQInput
node in the second message flow (called VALIDATINGXML2EDIFACT.msgflow), parses the message
and validates it against the message set:
- If the message is a valid XML message, it is is passed to the Compute node, which converts
the XML message to an EDIFACT message. The Compute node then passes the message to the
XML_TO_EDIFACT_OUT MQOutput node, which puts the message onto the XML_TO_EDIFACT_OUT queue.
- If the message is not a valid XML message, the message is passed to the EDIFACT_FAIL node,
which puts the message onto the EDIFACT_FAIL queue.
- In the Test Client, click Dequeue.
- In the Queue name field, type XML_TO_EDIFACT_OUT.
- Click Get Message to get the message from the XML_TO_EDIFACT_OUT queue.
The message is now an EDIFACT message.
If there is no message on the EDIFACT_TO XML_OUT or XML_TO_EDIFACT_OUT queues,
see Resolving problems when running samples
in the WebSphere Message Broker documentation. The message might still be on the input queue,
the EDIFACT_FAIL queue, or on one of the system queues.
The D.96A_INVOICE_missing_BGM.mbtest message
When you put the D.96A_INVOICE_missing_BGM.mbtest message through the first message flow,
the validation on the EDIFACT_TO_XML_IN MQInput node fails because the BGM field is missing
from the message. The EDIFACT_TO_XML_IN MQInput node puts the message onto the EDIFACT_FAIL queue.
Back to sample home