Scenario F: Updating the value of a message element

Before you start:
  1. Create the appropriate message model, either by using the tooling or by importing the message structure files (for example, C header or XML Schema Definition files).
  2. Create a message flow that has the following structure:
    MQInput > Mapping node > MQOutput
This scenario demonstrates how to update the value of a message element. The message model used in this example is:
simple		(message)
		int	(xsd:int)
		str	(xsd:str)
  1. Switch to the Broker Application Development perspective.
  2. Right-click the Mapping node and click Open Map.
  3. Accept the default project and name and click Next.
  4. Accept the default usage and click Next.
  5. Clear the Based on records in a database check box and click Next.
  6. Select the source message simple and the target message simple and click Finish.
  7. In the connection pane, open the source and target trees by clicking the addition (+) icons.
  8. Open the simple trees on both sides in the same way.
  9. Select int in the Message Mapping editor Source pane, and drag it onto int in the Target pane. A line joins them.
  10. Select str in the Message Mapping editor Source pane and drag it onto str in the Target pane. A line joins them.
  11. In the Map Script | Value table, open the tree by clicking the $target + box
  12. Open the simple tree in the same way; both int and str have values (for example, int $source/simple/int str $source/simple/str.
  13. Select the value for int. The value appears in the Expression Editing pane.
  14. Edit the value so that it is: $source/simple/int + 1 and press Enter. The value in the table is updated (this increments the input value).
  15. Select the value for str and edit it so that it is: esql:upper($source/simple/str), and press Enter. The value in the table is updated (this converts the input value to upper case).
  16. Save the mapping by clicking File > Save.
You have completed this scenario. The input and output messages have the same structure and format, but the element values have been modified.
Related reference
Message mappings