Many to Many Mapping Problem

Home Page Forums BizTalk 2004 – BizTalk 2010 Many to Many Mapping Problem

Viewing 1 reply thread
  • Author
    Posts
    • #15977

      Hi,

      I want to implemenet a many to many maping which should follow the following ogic:

       My Input XML file is:

      <INROOT>

      <Ins>
      <Start>2004-12-10</Start>
      <End>2006-12-31</End>
      <GroupName>XYZ</GroupName>
      </Ins>

      <Ins>
      <Start>2005-10-05</Start>
      <End>2006-11-12</End>
      <GroupName>ABC</GroupName>
      </Ins>

      <Ins>
      <Start>2005-03-13</Start>
      <End>2006-12-31</End>
      <GroupName>DEF</GroupName>
      </Ins>

      </INROOT>

      And I want the following output:

      <OUTROORT>

      <Matrix Start="2004-12-10" End="2005-03-12">
      <GroupName> XYZ </GroupName>
      </Matrix>

      <Matrix Start="2005-03-13" End="2005-10-04">
         <GroupName> XYZ </GroupName>
         <GroupName> DEF </GroupName>
      </Matrix>

      <Matrix Start="2005-10-05" End="2006-11-12">
         <GroupName> XYZ </GroupName>
         <GroupName> ABC </GroupName>
         <GroupName> DEF </GroupName>
      </Matrix>

      <Matrix Start="2005-11-13" End="2006-12-31">
        <GroupName> XYZ </GroupName>
        <GroupName> DEF </GroupName>
      </Matrix>

      </OUTROORT>

      The mapping logic would be:

      Divide all the date using start and end date (sorting based on start and date might be useful) and include all the Group name  which resides in that range..

      Any help would be highly appreciable..

      Akash

    • #16023

      This may prove slightly difficult and require more than one map.

      This could be a lot easier using XSLT 2.0, which supports creating intermediate document sets. However Biztalk does not yet support XSLT 2.0

      A quicker approach may be to use a .NET class called from within an orchestration.

      Or possibly writing the message to a SQL table and querying this table to produce the required output.

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