Multiple destinations Mapping

Home Page Forums BizTalk 2004 – BizTalk 2010 Multiple destinations Mapping

Viewing 1 reply thread
  • Author
    Posts
    • #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,

    • #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

      • #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….

         

        • #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

          • #20392

             Thanks, I tried it, however, with the destinations are FlatFile schemas, I dont know if this makes a difference,

            • #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.

              • #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.

                • #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.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.