BizTalk Server General - Complex mapping

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > December 2004 > Complex mapping





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Complex mapping
Btvn

2004-11-12, 7:48 am

Hi All,

How do I map many source records to single target record
in mapping.

I have input/source file schema which has multiple
records of same type. I Need to transform it to a target schema which will
have single record. Ofcourse few fields are to be picked up
from 1st record(or could be from any record as they are
same for all the records) as following:
<Root>
<SemiHeader a="7" b="6" />
<Header String1="String1_0" String2="String2_1" />
<ARecordA String1="A1_Row1" String2="String2_1" />
<ARecordA String1="A2_Row1" String2="String2_1" />
<ARecordA String1="A3_Row1" String2="String2_1" />
<ARecordA String1="A1_Row2" String2="String2_1" />
<ARecordA String1="A2_Row2" String2="String2_1" />
<ARecordA String1="A3_Row2" String2="String2_1" />
<ARecordA String1="A1_Row3" String2="String2_1" />
<ARecordA String1="A2_Row3" String2="String2_1" />
<ARecordA String1="A3_Row3" String2="String2_1" />
<ARecordA String1="A1_Row4" String2="String2_1" />
<ARecordA String1="A2_Row4" String2="String2_1" />
<ARecordA String1="A3_Row4" String2="String2_1" />
<Trailer Trailer1="Trailer1_0" Trailer2="Trailer2_1" />
<SemiFooter a="7" b="6" />
</Root>

And I want to receive output schema :
<Header String1="String1_0" String2="String2_1" >
<SemiHeader a="7" b="6">
<Records>
<Record A1="A1_Row1" A2="A2_Row1" A3="A3_Row1">
</Record>
<Record A1="A1_Row2" A2="A2_Row2" A3="A3_Row2">
</Record>
<Record A1="A1_Row3" A2="A2_Row3" A3="A3_Row3">
</Record>
<Record A1="A1_Row4" A2="A2_Row4" A3="A3_Row4">
</Record>
<SemiTotal a="7" b="6">
</Records>

I try to map it by using loop functiod, but this is my output schema :

<Records>
<Record A1="A1_Row1" A2="A2_Row1" A3="A3_Row1">
</Record>
<Record A1="A1_Row2" A2="A2_Row1" A3="A3_Row1">
</Record>
<Record A1="A1_Row3" A2="A2_Row1" A3="A3_Row1">
</Record>
<Record A1="A1_Row4" A2="A2_Row1" A3="A3_Row1">
</Record>
</Records>
I dont know how to map. Please help me to map it.

Thanks in advance and Best regard.


BizTalk Architect

2004-11-12, 7:48 am


"Btvn" <Btvn@discussions.microsoft.com> wrote in message
news:13169157-8BC1-43E8-99DC-20A547BD95D5@microsoft.com...
> Hi All,
>
> How do I map many source records to single target record
> in mapping.
>
> I have input/source file schema which has multiple
> records of same type. I Need to transform it to a target schema which will
> have single record. Ofcourse few fields are to be picked up
> from 1st record(or could be from any record as they are
> same for all the records) as following:
> <Root>
> <SemiHeader a="7" b="6" />
> <Header String1="String1_0" String2="String2_1" />
> <ARecordA String1="A1_Row1" String2="String2_1" />
> <ARecordA String1="A2_Row1" String2="String2_1" />
> <ARecordA String1="A3_Row1" String2="String2_1" />
> <ARecordA String1="A1_Row2" String2="String2_1" />
> <ARecordA String1="A2_Row2" String2="String2_1" />
> <ARecordA String1="A3_Row2" String2="String2_1" />
> <ARecordA String1="A1_Row3" String2="String2_1" />
> <ARecordA String1="A2_Row3" String2="String2_1" />
> <ARecordA String1="A3_Row3" String2="String2_1" />
> <ARecordA String1="A1_Row4" String2="String2_1" />
> <ARecordA String1="A2_Row4" String2="String2_1" />
> <ARecordA String1="A3_Row4" String2="String2_1" />
> <Trailer Trailer1="Trailer1_0" Trailer2="Trailer2_1" />
> <SemiFooter a="7" b="6" />
> </Root>
>
> And I want to receive output schema :
> <Header String1="String1_0" String2="String2_1" >
> <SemiHeader a="7" b="6">
> <Records>
> <Record A1="A1_Row1" A2="A2_Row1" A3="A3_Row1">
> </Record>
> <Record A1="A1_Row2" A2="A2_Row2" A3="A3_Row2">
> </Record>
> <Record A1="A1_Row3" A2="A2_Row3" A3="A3_Row3">
> </Record>
> <Record A1="A1_Row4" A2="A2_Row4" A3="A3_Row4">
> </Record>
> <SemiTotal a="7" b="6">
> </Records>
>
> I try to map it by using loop functiod, but this is my output schema :
>
> <Records>
> <Record A1="A1_Row1" A2="A2_Row1" A3="A3_Row1">
> </Record>
> <Record A1="A1_Row2" A2="A2_Row1" A3="A3_Row1">
> </Record>
> <Record A1="A1_Row3" A2="A2_Row1" A3="A3_Row1">
> </Record>
> <Record A1="A1_Row4" A2="A2_Row1" A3="A3_Row1">
> </Record>
> </Records>
> I dont know how to map. Please help me to map it.
>
> Thanks in advance and Best regard.
>
>


Have you tried the value mapping with flattening functoid?





Btvn

2004-11-12, 8:46 pm

I'm new to Biztalk. Can you explain more detail...??? or a sample like that.

"BizTalk Architect" wrote:

>
> "Btvn" <Btvn@discussions.microsoft.com> wrote in message
> news:13169157-8BC1-43E8-99DC-20A547BD95D5@microsoft.com...
>
> Have you tried the value mapping with flattening functoid?
>
>
>
>
>
>

Btvn

2004-11-15, 5:49 pm

I tried with index. But I need to group of 3 record in source file into one
record in destination. My source file is in XML format.
<Root>
<SemiHeader a="7" b="6" />
<Header String1="String1_0" String2="String2_1" />
<ARecordA String1="A1_Row1" String2="String2_1" />
<ARecordA String1="A2_Row1" String2="String2_1" />
<ARecordA String1="A3_Row1" String2="String2_1" />
<ARecordA String1="A1_Row2" String2="String2_1" />
<ARecordA String1="A2_Row2" String2="String2_1" />
<ARecordA String1="A3_Row2" String2="String2_1" />
<ARecordA String1="A1_Row3" String2="String2_1" />
<ARecordA String1="A2_Row3" String2="String2_1" />
<ARecordA String1="A3_Row3" String2="String2_1" />
<ARecordA String1="A1_Row4" String2="String2_1" />
<ARecordA String1="A2_Row4" String2="String2_1" />
<ARecordA String1="A3_Row4" String2="String2_1" />
<SemiFooter a="7" b="6" />
<Trailer Trailer1="Trailer1_0" Trailer2="Trailer2_1" />
</Root>
Can you give me an advice.or an sample like that. Thanks for your help...
"Btvn" wrote:
[vbcol=seagreen]
> I'm new to Biztalk. Can you explain more detail...??? or a sample like that.
>
> "BizTalk Architect" wrote:
>
Tan Bao Nguyen

2004-12-07, 5:49 pm

The index functoid won't help unless you have a deterministic number of
records. Note that the mapper doesn't support grouping. Hence, you will
need to use a scripting functoid and write some XSLT to do the mapping.

Regards,
Tan Nguyen
Microsoft BizTalk Server

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------[vbcol=seagreen]
<4194a1d6$0$21263$6c56d894@diablo.nl.easynet.net>
<11F681F6-A5D6-4150-8571-C568E079EAD8@microsoft.com>[vbcol=seagreen]
one[vbcol=seagreen]
that.[vbcol=seagreen]
which will[vbcol=seagreen]
schema :[vbcol=seagreen]

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com