If you are already familiar with the BizTalk Mapper tool within Visual Studio, you probably already know that it is easy to create a .btm map file in the BizTalk project, select a single source schema and a single destination schema, and then create your map graphically. However, what if you have multiple schemas that you want to aggregate them into a single destination schema, or better yet, into multiple destination schemas. It is not obvious how you can accomplish this in the mapping tool since it doesn’t seem to allow you to select more than one schemas, either source or destination, when you create the map. Actually, this can be accomplished with the help of an helper orchestration.
Here are the steps as an example:
- Create 4 schemas, name them source1, source2, destination1 and destination2 respectively.
- Instead of creating a map file (.btm) directly, create a new orchestration (.odx) file. This will be your helper orchestration and you can discard it after you are done.
- Inside the helper orchestration, create 4 messages, assigning them with the 4 schemas you create in step 1 respectively.
- Grab an Transform shape and throw it onto the orchestration designer surface.
- Double-click on the Transform shape, now you are in the Transformation Configuration dialog box.
- Make sure “New Map” checkbox is selected, then type in the map name you’d like.
- Add source1 and source2 messages as the Source of the Transformation.
- Then add destination1 and destination2 messages as the Destination of the Transformation.
- Make sure “When I click OK, launch the BizTalk Mapper” checkbox is selected.
- Hit OK. A new map will be created for you with Source1 and Source2 as source schemas under a single root record, and destination1 and destination2 as destination schemas under a single root record as well. Now you can go ahead design this map to your heart’s content.
- Optionally, again, you can delete the helper orchestration.
Unfortunately there is still no direct way to create this kind of maps in BizTalk Mapper. But with the help of an orchestration Transformation shape you can accomplish this as a work-around.