Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Multiple destinations Mapping
- This topic has 7 replies, 1 voice, and was last updated 9 years, 1 month ago by
community-content.
-
AuthorPosts
-
-
August 12, 2008 at 5:10 AM #20387
Dears,
I have a scenario where I want to map a source schema to different destinations. The destinations schemas are all the same, however, I want to filter the input Source schema by checking a certain element in the source schema, based on the value, I want to map the whole record to one of the destination schemas. Can I do this using maps ?As an example,
The source schema is
<Root>
<Header>HHH</Header>
<Node>
<Name>Test</Name>
<Age>10</Age>
</Node>
<Node>
<Name>Test</Name>
<Age>20</Age>
</Node>
<Node>
<Name>Test</Name>
<Age>30</Age>
</Node>
</Root>And the destination schema will be as follows:
<Root>
<Node>
<Name>Test</Name>
<Age>10</Age>
</Node>
<Node>
<Name>Test2</Name>
<Age>10</Age>
</Node>
</Root>I will be checking the age, and if it is < 20, I will map it to one destination , if it is >20 & <30, i will map it to the second destination, and if it is >30 I will map it to the third.
Can I do this in a single map??
Thanks in advance, -
August 12, 2008 at 6:13 AM #20389
Hi!
You can use a Less Than|Greater Than and a Value Mapping functoid. For example, for Age=10, if the value is les than 20, send true to the Value Mapping and it sends the Age to the destination. In other case return false and it doesn’t send.
I hope that it can be useful
Regards
Xurxo Garcia – MCTS Biztalk Server 2006
-
August 12, 2008 at 6:34 AM #20390
[quote user="xurxofg"]
Hi!
You can use a Less Than|Greater Than and a Value Mapping functoid. For example, for Age=10, if the value is les than 20, send true to the Value Mapping and it sends the Age to the destination. In other case return false and it doesn’t send.
I hope that it can be useful
Regards
Xurxo Garcia – MCTS Biztalk Server 2006
[/quote]
Thanks for your reply, I knew that I will be using the Less or greater functoid, however, the problem is that my input schema may contain 30 records, and they may be distributed as follows:
20 for the first destination schema (i.e <20)
7 for the second destination schema (i.e >20 && <30)
3 for the third schema (i.e. >30)
I want to do this splitting in one map, and I tried it, only I get the first record mapped, and others doesn’t get mapped….
-
August 12, 2008 at 6:42 AM #20391
You should be use a Looping funtoid between both root nodes.
And check if the destination root is a (1, *) record, because if it isn’t you can’t make this assigment (sorry, not root, fied “node” in both sides must be (1, *) )
Regards
-
August 12, 2008 at 6:46 AM #20392
Thanks, I tried it, however, with the destinations are FlatFile schemas, I dont know if this makes a difference,
-
August 12, 2008 at 8:25 PM #20398
Hmmm, I think maps can have multiple input and output files, but it is like pulling teeth to get it to work. It would probably be much easiear to create multiple maps in this case. Alternatively, you could just a few XPath statements to extract the records you want.
-
August 12, 2008 at 11:45 PM #20400
Thanks ruselw,
What I was thinking in, is to avoid going through the input source multiple times; as in using different maps, the input source will be searched different times, however, in a single map this will be done once.
-
April 1, 2009 at 1:02 PM #22066
Hi,
I have a similar case: a repeating input element:
<SQLRequests>
<r requestType=”1″ …>
<r requestType=”2″ …>
<r requestType=”2″ …>
<r requestType=”1″ …>
<r requestType=”1″ …>
<r requestType=”2″ …>
…
</SQLRequests>
that should be split into multiple output elements, based on the attribute value:
<SQLRequestsSplit>
<requestType1 …>
<requestType2 …>
<requestType1 …>
<requestType1 …>
<requestType1 …>
<requestType2 …>
…
</SQLRequestsSplit>
After several attempts to use various advanced functoids, I added an intermediate schema, with separate elements. Then, I added a map with a custom XSLT, that did the split, and I plan to add another map, that will map SQLRequestsSplit into the target flat-file schema with two different record types.
I hope this helps.
Regards,
Goce.
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.