BizTalk's strength is in message transformation without hassle using maps. You dont have to bother about actual transformation done in xsl and can just start linking up elements from source and destinations to transform message. It is easy to create a map but it is difficult to decide and execute a map dynamically.
Not untill I came to know about a way to transform a message dynamically i.e. calling a map runtime. I had used dotnet code to call maps dynamically but again that was not quite handy. Here I am listing a few steps which will walk you through:
- Create a received message say msgIN
- Create a out message say msgOUT
- Create a variable say mapName of System.String type
- Create a variable say mapType of System.Type type
- Create a map with In_To_Out which will map your messages.
Now you will have to assign map name to the variable. This name has to be fully qualified name of map. e.g. BizTalk.Poc.CallRules.CreditResponseMap, BizTalk.Poc.CallRules, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6fbea855e353a1f3
Now create a type variable of this map mapType = System.Type.GetType(mapName).
We will execute this map to create message like: transform(msgOUT) = mapType(msgIN).
This statement shoyuld be within message assignment shape. We can replace name of map based on condition in our code and that will execute map dynamically.
Easy, isn't it? :-)