Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Mapping values from one schema into another based.
- This topic has 1 reply, 1 voice, and was last updated 6 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
July 11, 2006 at 3:24 PM #15017
Hello, and thanks.
So I have 2 Schemas, The first holds Order Items, similar to:
<SalesOrder id=\”blah\”>
<Items>
<Item Id=\”item_1\” Quantity=\”7\” Supplier=\”\” SupplierProductId=\”\” />
<Item Id=\”item_2\” Quantity=\”8\” Supplier=\”\” SupplierProductId=\”\” />
<Item Id=\”item_3\” Quantity=\”9\” Supplier=\”\” SupplierProductId=\”\” />
<Item Id=\”item_4\” Quantity=\”10\” Supplier=\”\” SupplierProductId=\”\” />
</Items>
</SalesOrder>The second holds product mapping for suppliers, similar to:
<ProductMapping>
<Products>
<Product ProductId=\”item_1\” SupplierProductId=\”item_44\” Supplier=\”supplier_1\” />
<Product ProductId=\”item_2\” SupplierProductId=\”item_55\” Supplier=\”supplier_2\” />
<Product ProductId=\”item_3\” SupplierProductId=\”item_66\” Supplier=\”supplier_1\” />
<Product ProductId=\”item_4\” SupplierProductId=\”item_77\” Supplier=\”supplier_3\” />
</Products>
</ProductMapping>I need to Map the Suppliers from ProductMapping into the SalesOrder, so for this example the final result will be.
<SalesOrder id=\”blah\”>
<Items>
<Item Id=\”item_1\” Quantity=\”7\” Supplier=\”supplier_1\” SupplierProductId=\”item_44\” />
<Item Id=\”item_2\” Quantity=\”8\” Supplier=\”supplier_2\” SupplierProductId=\”item_55\” />
<Item Id=\”item_3\” Quantity=\”9\” Supplier=\”supplier_1\” SupplierProductId=\”item_66\” />
<Item Id=\”item_4\” Quantity=\”10\” Supplier=\”supplier_3\” SupplierProductId=\”item_77\” />
</Items>
</SalesOrder>Currently, I am looping all of the items in the SalesOrder and then looping all of the items in the ProductMapping and where a match is found, the Supplier and SupplierProductId information is added to a new copy of the SalesOrder.
This method seems to be much more work than is needed, I tried setting up a map transform to accomplish this, but couldn’t get it to work, does any one know of a sample similar to this or a better method I could use to accomplish this?
Thanks,
–Steven -
July 11, 2006 at 7:13 PM #15018
If anyone else runs into this problem, here is the solution, pretty easy to implement.
There is a sample in \”The Bloggers Guide To BizTalk V 1.8\”
http://www.gotdotnet.com/workspaces/workspace.aspx?id=0dfb4f4e-d241-4bc8-8418-2c385d8e3eaaIt’s under BizTalk Development > Maps > Mapping 2 Schemas with a 1:1
relationship in the BizTalk 2004 MapperThanks,
–Steven
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.