Saturday 19 April 2014

56 - How to re-point a session task to a different mapping

Why -- Though it's not an interview question, but at the time of development you will some time you will feel the need to do so. 

Lets assume you have a mapping say Map1 and its respective session / task as Session1. Now I have to do some logic change in my Map1, so before doing that I created a backup of it "Map2" and done the changes in my original Map1.

So my current Mapping and Session relation is as below



We have our original Map1 connected to Session1 and a backup Map2 which is not attached with any task currently.

After modifying Map1, business team ask to revert back the changes and now you want Session to point to Map2 [backup mapping] instead of Map1.


How -- How will you point your session to map2? there are 2 ways as below

1. Rename the mapping name -- You export your Map2 and edit that into editor to replace Map2 to Map1. By simply changing the export file name from Map2 to Map1 won't help, but you need to replace actual content [ mapping name tag value] inside the file.
Once you re-named the content of your xml file from Map2 to Map1, simply import it again and replace all existing objects [source, target, mapping] of it. Now your Map1 will have your original contents which were prior to any changes.

2. Invalidate the Map1 -- This is a simplest way of doing it. Just invalidate the map1 [ delete the target from your mapping and it will get invalidated] and refresh your workflow. Since your mapping is invalid, informatica will prompt to you point the workflow to a valid mapping.


Now just re-point your session to Map2 which was your original code.

No comments:

Post a Comment