|
Home > Archive > BizTalk Server General > June 2006 > Many to Many Map: Logical Existence
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 |
Many to Many Map: Logical Existence
|
|
|
| Hi, I have an interesting problem:
I have three messages that are being mapped into two different
messages.
The three input messages look something like:
<Message>
<Record>
<HeaderID>1<HeaderID>
<Stuff I Need/>
<Line><LineID>1<LineID><Stuff I Need/></Line>
<Line>...</Line>
</Record>
<Record>...</Record>
</Message>
....the only thing that is different about them is the "Stuff I Need"
part.
So I'm trying to map these into two output messages an "OK" and an
"Error" message.
"OK" message looks like:
<Message>
<Line><Stuff/></Line>
<Line>...</Line>
</Message>
"Error" message is the same as Message 1.
I can map into an "OK" message (when by itself) fine.
Where I'm having trouble is in the Logical Existence of the "OK" and
"Error" messages when mapping 3 to 2.
Message 2 and 3 on the Line level have an "Error" field.
What I want to say is something like "if error in message 2 or 3 (on
the line level), then dont' create the line in the "OK" message".
So, while I can create the nodes of the "OK" message using inline XSLT,
something like:
<xsl:template name="GetNodeTemplate">
<xsl:param name="HeaderID" />
<xsl:param name="LineID" />
<xsl:element name="Stuff1">
<xsl:value-of select="//Record/Header[HeaderID=$HeaderID]/Line[LineID =
$LineID]/Stuff1" />
</xsl:element>
</xsl:template>
....I cannot get the value of this node out of the script functoid into
another functoid.
I've also tried using inline c# with xpath, but haven't been able to
get that done.
Any suggestions are welcome!!!
If anyone has seen examples of using system.xml.xpath inside a Map,
please refer me!
Thanks :D
Ana
| |
|
| I didn't end up figuring out how to do a many to many mapping...
What I ended up doing is creating an intermediate "merged" schema from
the three input messages and then splitting it back up into the two
output messages that I wanted.
Essentially I replaced a many-to-many map with a many-to-one map and a
one-to-many map.
Cheers,
Ana
AnaB wrote:
> Hi, I have an interesting problem:
> I have three messages that are being mapped into two different
> messages.
> The three input messages look something like:
>
> <Message>
> <Record>
> <HeaderID>1<HeaderID>
> <Stuff I Need/>
> <Line><LineID>1<LineID><Stuff I Need/></Line>
> <Line>...</Line>
> </Record>
> <Record>...</Record>
> </Message>
>
> ...the only thing that is different about them is the "Stuff I Need"
> part.
>
> So I'm trying to map these into two output messages an "OK" and an
> "Error" message.
> "OK" message looks like:
> <Message>
> <Line><Stuff/></Line>
> <Line>...</Line>
> </Message>
>
> "Error" message is the same as Message 1.
>
> I can map into an "OK" message (when by itself) fine.
>
> Where I'm having trouble is in the Logical Existence of the "OK" and
> "Error" messages when mapping 3 to 2.
>
> Message 2 and 3 on the Line level have an "Error" field.
>
> What I want to say is something like "if error in message 2 or 3 (on
> the line level), then dont' create the line in the "OK" message".
>
> So, while I can create the nodes of the "OK" message using inline XSLT,
> something like:
>
> <xsl:template name="GetNodeTemplate">
>
> <xsl:param name="HeaderID" />
> <xsl:param name="LineID" />
>
> <xsl:element name="Stuff1">
> <xsl:value-of select="//Record/Header[HeaderID=$HeaderID]/Line[LineID =
> $LineID]/Stuff1" />
> </xsl:element>
>
> </xsl:template>
>
> ...I cannot get the value of this node out of the script functoid into
> another functoid.
> I've also tried using inline c# with xpath, but haven't been able to
> get that done.
>
> Any suggestions are welcome!!!
> If anyone has seen examples of using system.xml.xpath inside a Map,
> please refer me!
>
> Thanks :D
> Ana
|
|
|
|
|