Creating Multiple Input Maps for BizTalk Server 2004
When you create a new map in BizTalk Server 2004 through the Add New Item menu in Visual Studio .NET 2003, you are presented with a 3 pane window. On the left side is a link that says "Open Source Schema". Clicking on this link will open the Select Artifact dialog box containing any schemas found that are referenced in your project (or other referenced assemblies). You select the source schema, select the destination schema and then start the process of creating the schema links. However, the Select Artifact dialog will only let you choose 1 source schema. What if you wanted to actually select 2 or more source schemas in order to create a document merge type of map? Well, that's exactly what this post is about. Read on...
NOTE: I'm a tutorial type of person. A hands on, learn by doing type of person. As you read along, feel free to actually perform these steps.
The 1st prerequisite step is to create an empty BizTalk Server project (obviously).
The 2nd prerequisite step is to design your schemas (or at least have them referenced in your project if they've already been generated). For the sake of keeping this post small, I will forego the procedure of schema generation and will use 3 canned schemas that you can download by following these links:
https://codepunk.members.winisp.net/blogfiles/MultiInputMap/ProductInformation.xsd <- Source schema #1
https://codepunk.members.winisp.net/blogfiles/MultiInputMap/CustomerInformation.xsd <- Source schema #2
https://codepunk.members.winisp.net/blogfiles/MultiInputMap/CustomerProductQuery.xsd <- Destination Schema
At this point, you should have a BizTalk Server Project with the 3 imported schemas. Now normally you would click on Project, Add New Item to create a map but remember, you can only specify a single source schema. Follow these steps to create a multiple input map:
Create an Orchestration |
|
Creating the Messages |
|
Creating the Multiple Input Map |
Your Transform Configuration dialog should look similar to the following figure: |
At this point you have created a map which accepts 2 source documents and generates a single destination document. When BizTalk Mapper opens you'll notice that each source schema is contained within an InputMessagePart_0 or InputMessagePart_1 element. You can then create the BizTalk map links just as you normally would.
Important: You can now delete the orchestration that you created for this little exercise. However, when you use the map in your project later you have to make sure that the source schemas are in the correct order. In other words, when you double click the Transform shape and select Existing Map, each row that corresponds to one of the source schemas must be in the same order as when you created the map in the first place. In the above example, if I were to first select CustomerInformationMessage followed by ProductInformationMessage as the 2 source schemas in my Transform shape, your map will not work as you expect it to.
So there you have it, the procedures to create multiple input maps in BizTalk Server 2004. It's a simple process but in my opinion is a really nice know-how to have on your mental utility belt. Let me know if you found this little nugget useful.
Comments
Anonymous
September 19, 2005
Solves a problem for me of how to merge data that you could not otherwise introduce here. It is just a shame that you cannot just add multiple schemas to the left pane of a map in a dedicated map module without the kludge of going round the houses.
As you say, add it to the mental toolkit. Thanks for the tip.Anonymous
December 08, 2005
I tried this but it doesn't work. I was expecting that all of hte data that that I map from ProductInformationMessage and CustomerInformationMessage will be mapped out in destination schema CustomerPropertyQuery Message.However, I only get the CustomerInformation message in the final message.Anonymous
December 14, 2005
I am getting the same problem. The document in the first message part is not being mapped. It is as though no document was supplied to the map.Anonymous
August 09, 2006
Hi
This informaiton is very useful in my case. I am very happy to say that my problem is solved by this information.
~AmbarAnonymous
April 01, 2007
Thanks for the information. It was very useful.Anonymous
December 20, 2007
Only works for new maps. What about adding a schema to an existing map?Anonymous
February 12, 2009
PingBack from http://debelog.wordpress.com/2009/02/13/creating-multiple-input-maps-for-biztalk-server/Anonymous
June 09, 2009
PingBack from http://quickdietsite.info/story.php?id=4087