Iteration issue

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Iteration issue

Viewing 1 reply thread
  • Author
    Posts
    • #23524

      Hi All,

      I face with one problem regarding records numbering (iteration) for which currently do not have solution and hope that you can help me.
      Namely, is neccesery to reset iterator if some field <OrderNumber> from input schema change value.
      For example if this is source schema :
      <Orders>
         <Order>
                        <OrderNumber>
                        <Customer Number>
                        <ShipDate>
                        <DeliveryDate>
                        <Adress>
                        <ZipCode>
                        <Town>
                        <ItemNo>
                        <Quantity>
                        <Amount>
                        <Status>
                        <Shipment>

      and if this is destination schema :
      <Order>
          <OrderHeader>
                <OrderNumber>
                <Customer>
                <ShipDate>
                <DeliveryDate>
                <Adress>
                <ZipCode>
                <Town>
          <OrderLine>
                <OrderNumber>
                <LineNumber>
                <ItemNo>
                <Amount>
                <Quantity>
      I would like to reset iterator to 1 every time when the value of field <OrderNumber> is changed.
      For example if this is input :
      10001;customer;12/12/2009;12/12/2009;Adress;129999;London;R33331;100;10000;Released;CIF;10001;customer;12/12/2009;12/12/2009;Adress;129999;London;R33336;500;60000;Released;CIF
      10002;customer;12/15/2009;12/15/2009;Adress;129999;Paris;R33331;100;10000;Released;CIF
      10002;customer;12/15/2009;12/15/2009;Adress;129999;Paris;R33336;900;90000;Released;CIF
      I want to achive this :
      10001;Customer;12/12/2009;12/12/2009;Adress;129999;London
      10002;Customer;12/15/2009;12/15/2009;Adress;129999;Paris
      10001;1;R33331;10000;100 
      10001;2;R33336;50000;600 
      10002;1;R33331;10000;100 
      10002;2;R33336;90000;900 
      it means to reset iterator to 1 when the field <OrderNumber> change the value (as see on this example when order number is 10002 to get back iterator to 1 and to start to iterate again).
      Hope that this is not so much difficult problem.
      THANKS IN ADVANCE

    • #23528

      Hi,

       

          You probably should build a scripting functoid in your map using inline C# to store your previous OrderNumber (and fetch it back) and store your iterator (and fetch it back), in four publicly declared subroutines, and call those routines in your map.

       

          Have a look at the following blog by Richard Seroter, showing an example of how to call inline C# code from an XSLT functoid in a BizTalk map:

      http://seroter.wordpress.com/2007/05/24/calling-inline-net-code-from-inline-xslt-in-biztalk/

       

          Following the pattern of Richard’s example, you can achieve your goal.

       

         Best,

       

         Daniel.

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