IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Defining and transforming data > Transforming data > Transforming data using XML maps > Create a new XML map

Create an XML map in a Mapping transformation primitive

While working in the mediation flow editor, you can launch the XML map editor from a Mapping transformation primitive to create an XML map between the input and output message. When the map has been created, an XSL style sheet will be generated to perform the transformation at run time. If you want to create a new XML map for a Mapping primitive but an XML map already exists, you can use the Properties view of the mediation flow editor to create the new XML map and simultaneously choose whether to have the existing XML map overridden, deleted, or retained.


Prerequisite Before you begin, you need a mediation flow with the source interface and target reference defined. Open the mediation flow, and drag a Mapping transformation primitive onto the canvas of the request or response flow.

When you create an XML map, you first need to decide the following:

To quickly create an XML map with a specific input and output type, follow these steps:

  1. Drop a Mapping transformation primitive on to the canvas of the mediation flow editor.
  2. Wire the input and output terminals of the primitive
  3. Double-click the primitive to open the XML mapping wizard.

  4. Click Finish to accept the defaults.

    An XML map created in this manner has a root of /body, and the input and output message types of the map are the same as those of the primitive. By default, a sample input file is created. You can use this file to test the map you create.

    If you do not need to change the information in the headers or contexts sections of the service message object, use /body as the mapping starting point. When you select /, /headers or /context as the root, you need to explicitly map all of the service message object sections in the XML map editor using the Match Mapping option. Otherwise, you might get errors at run time.

  5. The XML map editor opens, with the source message on the left and the target on the right. Expand the message trees in the source and target sections of the map editor, until you reach the elements that you want to map. Click an element in the Source section drag it to the matching element in the target section.

To quickly create an XML map with an input and output type of anyType, follow these steps:

  1. Drop a Mapping transformation primitive on to the canvas of the mediation flow editor.

  2. Optional: Wire the input and output terminals of the primitive.
  3. Double-click the primitive to open the XML mapping wizard.

  4. To enable high performance XML mapping, enable the Enable high performance XML mapping using BO map execution check box.

  5. Click Next.

  6. For both the input and output messages, identify the part of the message that is available to the transformation by selecting an option in the Message Root list:

    • / to transform the complete message. To map SOAP attachments, use / as the root.
    • /body to transform the message body
    • /headers to transform the message headers
    • /context to transform the message context

  7. If your Mapping transformation primitive has both input and output terminals wired, the wizard shows the input and output message types that will be mapped. If you need to specify the message types, click Browse, then Browse again and select an interface from the list.

  8. Select an operation, the message category and finally the message type. Click OK to return to the New XML Mapping wizard

  9. Click Finish to launch the XML map editor.

  10. In the editor, the source message is on the left and the target on the right. Expand the message trees in the source and target sections of the map editor, until you reach the elements that you want to map. Click an element in the Source section drag it to the matching element in the target section.

You can also use the Properties view to launch the New XML Map wizard and create a new XML map that uses either the default or modified settings described in the sections above. However, the Properties view is especially useful if you want to create a new XML map when an existing XML map already exists for your Mapping transformation primitive:

  1. Right-click your Mapping transformation primitive and select Show in Properties. The Properties view opens at the bottom of the mediation flow editor.

  2. In the Properties view, click the Details tab.
  3. Beside the Mapping file field, click New. The New XML Map wizard opens.

  4. On the first page of the wizard, accept the default values and click Next.

  5. If a Manage the Existing Map page is displayed, an XML map already exists for your Mapping transformation primitive and you should select one of the following radio buttons to specify what you want to do with the existing map:

    • Override the existing map Creates a new map with the same name as the existing map and replaces the existing map.

    • Create a new map and delete the existing map Creates a new map with a different name than the existing map, but removes the existing map.

    • Create a new map and keep the existing map Creates a new map with a different name than the existing map, but retains the existing map.

  6. Click Next.
  7. Either accept the default message types or modify them as described in the above section, then click Finish.

Create a new XML map


Related concepts:
Defining a map generation engine