Grouping and creating a new record in the Destination schema while mapping.

Home Page Forums BizTalk 2004 – BizTalk 2010 Grouping and creating a new record in the Destination schema while mapping.

Viewing 1 reply thread
  • Author
    Posts
    • #22715

      My Inbound schema contains “Details” record which contains number of elements underneath containing information. My outbound schema contains two records “Header” and “Details” (one level below the header) which have elements underneath. My requirement is based on a element value in Inbound schema if it is the first time i am reading the value i need to create a new “Header” and fill in “Details” record, otherwise if the value read has been already read i need to just create one more “Details” record under the “Header” record already created. Here is a prototype of the schema.

      Inbound:

      Details

               element1

                element2 (value = 1)

                element3

      Details

                       element1

                element2(value = 2)

                element3

      Details

                         element1

                element2(value = 1)

                element3

       

      Outbound Schema:

      Header

            Details

               element1

                element2 (value = 1)

                element3

            Details

               element1

                element2 (value = 1)

                element3

      Header

       

      Header

            Details

               element1

                element2 (value = 2)

                element3

      Header

      Please help me on this. i am stuck at this point for the last couple of days. Any help would be appreciated.

      Thanks

    • #22734

      You can achieve this functionality in BizTalk mapper. In the map use a Global Array to store the Last Element Value. Initialize with empty first value. Now have one scripting functoid, check if the current element value is present in the Global Array or not, if its not present then return true, also add the Element Value in the Global Array and create the record as Header else return false (add the record as detail).

      Now take one logical Equalto with Parameter1=output of above Scripting Functoid Parameter2=true and map to Header Node. So it will create Header node when you will not have Element Value in the Global Array.

      Map the Logical NOT of EqualTo functoid to Details Node. So in case Element value is present in the Global Array, it will createonly Detail record.

       

      Let me know if any issues.

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