WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Mapping LocalEnvironment data

Use the Graphical Data Mapping editor to transform LocalEnvironment data.

When you create a top level graphical data map, only the Properties folder is initially included in the map, and a default transformation from input to output properties is created in a local map.

You can then use the Message Assembly properties page in the Graphical Data Mapping editor to modify the LocalEnvironment folders included in the mapping:
  1. Select Message Assembly, and in the Properties view select the General tab.
  2. Next to the Headers and folders field, click Edit... to open a list of available headers and folders. See Headers and folders for the Mapping node for a list.

    Cast the any element to select the dec element, and again to select the str element.

    Screen capture that shows the Cast any element, which allows Dec to be Cast to select the str element.

    Note: The XML schema elements must be defined to match both the name and namespace of the data elements that the ESQL or other compute is accessing them with. Typically, as in the example shown no namespaces are used, so the XML schema does not define a Target Namespace.
  3. Select Selected headers and other folders, and then check LocalEnvironment. Click OK.

Screen capture that shows the Message Assembly properties page. The LocalEnvironment folder is expanded and within it, properties are included in the mapping

When a LocalEnvironment folder is included in the map, only the fields that are mapped by transforms in the map are created in the output message assembly that is propagated from the Mapping node.

When the folders are included in the map, you can map them using the available transforms. For more information about the transforms that are available, see Transform types in the Graphical Data Mapping editor.

The Mapping node copies the LocalEnvironment and any other headers and folders from input to output, unchanged when they are not included in the map. To copy or modify LocalEnvironment, add it to both or either of the input and output Message assembly in the map, and provide transformations. To delete LocalEnvironment, add it to the input Message Assembly, but not the output. To create a LocalEnvironment, add it only to the output.

You must provide transforms that copy all fields that are required to be copied and those fields to be modified. Many WebSphere® Message Broker nodes depend on information in LocalEnvironment being copied along the flow. If you require to modify only some fields, use a Move transform to copy LocalEnvironment and then use overrides to modify the elements you must update. For more information, see Applying mapping overrides.

If you want to map from data that is contained within the Variables section of the LocalEnvironment, you must first cast the 'any' element to the necessary type.

For example:

If an ESQL compute node has two simple fields in Local Environment under Variables that are set by the following ESQL:

SET OutputLocalEnvironment.Variables.dec = 10.1;
SET OutputLocalEnvironment.Variables.str = 'Some text';

To access these fields in a Mapping node, create a schema file in your Application or Library to define the elements and their type. Note that since the ESQL is not using any namespace to qualify these elements, the schema is also defined without a namespace declaration:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <xsd:element name="dec"  type="xsd:decimal"/>
       <xsd:element name="str"  type="xsd:string"/>
</xsd:schema>

Once the schema file is saved, you can then select the "any" element under the Variables section in the LocalEnvironment, and use the context menu action Cast... to add a Mapping cast for each of the elements "dec" and "str" that are required in the map. For more information, see Mapping casts.

Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:48:26


Task topicTask topic | Version 8.0.0.7 | br28671_