116 WebSphere Business Integration Message Broker Basics
4.3.2 Modifying the BookstoreFlow message flow
The BookstoreFlow message flow currently contains three nodes:
An MQInput node to retrieve the input message from the IN queue
A Compute node to process the input message to generate an output
An MQOutput node to put the output message on the OUT queue.
The Compute node in the BookstoreFlow is capable of modifying the message
and generating a new message. However, all information about the message
structure is held in the message itself (the XML message is self-defining), so the
Compute node must be programmed, using ESQL, to perform the processing on
the message. The more complex the processing, the more complex the ESQL
must be, which makes the message flow more complex to maintain and debug.
If the logical structure of the XML message is externally defined in a message
set, you do not have to program such complex ESQL to manipulate the message.
The message flow refers, instead, to the external message set for information
about each message that it processes. If you create a message set, you can use
a Mapping node instead of the Computer node.
The Mapping node enables you to load into the Mapping editor the input
message (BookStoreOrder) and output message (ShippingDetails) structures
from the message set. You can then simply drag and drop elements from the
input message onto elements in the output message to show which data should
be used from the input message to create the output message.
Mapping fields from one message to another is useful if, for example, the
business application that sends the message to the broker structures the data in
the message differently from the business application that will receive the
message. If the first business application positions the customer’s first name
before their last name but the second business application expects the
customer’s last name to precede their first name in the message, the Mapping
node can map the fields so that each business application can understand the
In the BookstoreFlow message flow, in addition to replacing the Compute node,
edit the properties of the MQInput node so that it uses the correct message set to
parse input messages. In addition, to avoid conflict between the original version
of the BookstoreFlow message flow and the new version of BookstoreFlow
message flow in the broker, before you deploy the new version of the
BookstoreFlow message flow, you must create a new execution group and two
new WebSphere MQ local queues.
Chapter 4. Application development 117
Replacing the Compute node with a Mapping node
To modify the BookstoreFlow message flow by replacing the Compute node with
a Mapping node:
1. In the Resource Navigator view, double-click BookstoreFlow.msgflow to
open the BookstoreFlow message flow in the Message Flow Editor.
2. In the Message Flow Editor, right-click the Compute node, then click Delete.
The Compute node is deleted from the BookstoreFlow message flow.
3. From the node palette, select the Mapping node and add it to the canvas
between the MQInput node and the MQOutput node.
4. Connect the nodes (Figure 4-23), then save BookstoreFlow.msgflow.
Figure 4-23 Modified BookstoreFlow message flow
Editing the MQInput node properties
To add information about the Bookstore message that is set to the MQInput
1. In the Message Flow Editor, right-click the MQInput node, then click
2. On the Default page of the Properties dialog box, edit the properties as shown
in Figure 4-24 on page 118:
a. From the Message Domain list, select MRM.
b. From the Message Set list, select the unique identifier of the message set
that you created. (The value shown in the figure is different from the
identifier that you are using.)
c. In the Message Type field, type BookStoreOrder.
d. From the Message Format list, select XML1.
3. Click OK to close the Properties dialog.
4. Save BookstoreFlow.msgflow.
118 WebSphere Business Integration Message Broker Basics
Figure 4-24 Editing the MQInput node properties to specify message set details
Configuring the Mapping node
The Mapping node enables you to drag and drop fields of the input message,
BookStoreOrder, onto fields of the output message, ShippingDetails, to map the
content of the input message onto the output message.
To configure the Mapping node:
1. In BookstoreFlow.msgflow, right-click the Mapping node, then click Open
Mappings. A mappings file called BookstoreFlow_Mapping.mfmap is
created. BookstoreFlow_Mapping.mfmap automatically opens in the Mapping
editor (Figure 4-25 on page 119).