Monday, May 3, 2010

Updating XML Maps in WebSphere Integration Developer When Service Message Object (SMO) Context Changes

Update XML maps when service context on Service Message Object (SMO) changes with out having to redo the existing mappings.

Consider the scenario in which you have created a mediation module where you used XSL Transformation primitive to transform messages and have chosen the Message Root for this primitive to be the root of the Service Message Object (SMO).

If you now try to set up the correlation, transient or shared context on the input node of the flow and want to do the mappings for the same in the XML maps that you originally created, the new object that was added to the context will not show up and you will see a warning message that the context type does not match as shown below.

Warning Message

How do I now update the XML map with out having to redo my mappings?

Right click on the XML map and select “Open With>XML Editor”. You will see all the mappings in an XML format. What you are looking for are the tags <mapping></mapping>.

XML Mappings
Now rename the current XML map to <name>_old and create a new one select the Message Root to be “/” and having the same input and output as the original map.

Once the map is created, right click and select “Open With>XML Editor”, and copy the mappings (all the <mapping> tags) from the old map to the new one.

Close the new XML map and reopen it using the Mapping Editor and you should see all your old mappings. You will also see the context of the SMO updated with your changes.

New Request Map With Correlation Context

When you have submaps in the original mappings, you can basically use them as-is. Any updates to the Business Objects will be reflected automatically on the XML maps.

No comments:

Post a Comment