Developing mappings

Before you start:

Before you can work with mappings, use the Message Brokers Toolkit for WebSphere Studio to complete the following tasks:
This topic area describes the tasks that are involved in creating and maintaining mappings.
  1. Open the Message Flow Mapping editor by right-clicking the node with which you want to work and clicking Open Mappings.

    The name of the mapping files that are created is of the form flowname_nodename. For example, if you launch the Message Flow Mapping editor from a new Mapping node called Mapping in a flow called topflow, the mapping file's name is topflow_Mapping.mfmap. If there is another Mapping node in the same flow called Mapping1, launching the editor from this node opens the file topflow_Mapping1.mfmap, because the root file topflow_Mapping1 is distinct from topflow_Mapping.

    The Message Flow Mapping editor is populated using information from schema files, and shows message or database structures in the form of a tree. If the message structure contains extensions of base types, the Mapping node has a limitation such that it does not show the elements inherited from these base types. Nesting levels of message structures with possibly recursive data types can be infinite. Mapping information is stored in a resource that is separate from the resource that contains the message flow information, and mapping resources are visible in the Resource Navigator view.

    Fields that have been mapped are highlighted with a small arrow to the left of the field name. If a previously-mapped input or output no longer exists in a message or database definition, it is described as unresolvable in the task list.

  2. In the Message Flow Mapping editor Outline view you can add, modify, or remove namespace prefixes that have been defined for a mapping routine.

    The namespace prefixes are needed when mapping something that involves a target namespace. You can also add or modify broker schema paths so that a mapping statement can refer to an ESQL subroutine in another broker schema without having to use the fully-qualified path. The Organize Schema References option is used to generate schema paths automatically. You can also use the Outline view to rename the mapping routine. Each Mapping node is associated with a named mapping routine and, although they share the same name initially, the mapping routine and mapping file are independent.

  3. From the Target view, select Output Message Properties and choose one of the defined messages as the output message body along with a wire format.

    This is useful when a mapping routine involves multiple messages, because it allows you to specify the message to be set as the output message body. However, if the mapping routine contains only one output message, you still need to set the message to be the output message body if the output message is different from the input message.

    You cannot use the following correlation names in the expression of any mapping for a Mapping, Extract, Warehouse, DataInsert, DataUpdate, or DataDelete node:
    • Environment
    • Root
    • Body
    • Properties
    • DesintationList
    • ExceptionList
    • LocalEnvironment
    • InputRoot
    • InputBody
    • InputProperties
    • InputDestinationList
    • InputExceptionList
    • InputLocalEnvironment
    • OutputRoot
    • OutputDestinationList
    • OutputExceptionList
    • OuputLocalEnvironment.

    The order of mapping statements in the resulting mapping ESQL routine (and consequently, their execution order) is determined by the order of mapping targets (message elements and database table columns). In cases where there are multiple message mapping routines on the target side, one of them can be declared as the resulting message body in the Message Flow Mapping editor. This means that the other message mapping routines represent the resulting message headers and ESQL statements corresponding to these message mapping routines are generated first in the resulting mapping ESQL procedure.

    If there are multiple mappings with the same target, an ESQL statement is generated for each mapping. The order of generated statements in this case is undefined; the target item value might be overridden and the resulting value will be the one that corresponds to the last mapping.

    In mapping objects, mapping editors, and mapping expression composers, the notation "I#" (including double quotes) is used as the index for a repeating structure. This index is displayed as I# (without double quotes) in the debugger variable view and in error or warning messages. To avoid unexpected results, do not use double quotes in the name of a message element, message attribute, or a database table.

Related concepts
Mappings
Mapping types
Message mapping
Namespaces in the message model
Correlation names
Related tasks
Creating a mapping file
Configuring a mapping
Mapping and ESQL
Defining mappings
Related reference
Mappings