Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Grouping and creating a new record in the Destination schema while mapping.
- This topic has 1 reply, 1 voice, and was last updated 9 years, 3 months ago by
community-content.
-
AuthorPosts
-
-
June 23, 2009 at 6:02 PM #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
-
June 29, 2009 at 8:32 AM #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.
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.