BizTalk Server General - INteresting mapping issue as a result of BizTalk limitation

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > November 2004 > INteresting mapping issue as a result of BizTalk limitation





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 INteresting mapping issue as a result of BizTalk limitation
Carlos Alberto

2004-11-22, 5:48 pm

Hello all,

I have a map that maps the following:

Incomign Schema


<Order>
<OrderHeader>
<LineITem>
<ItemID>
<Qty>
<Des>
</LineItem>
</OrderHeader>
</Order>

TO

Outgoing Schema


<Order>
<OrderHeader>
<CANCELSTATUS>
<LineITem>
<ItemID>
<Qty>
<Des>
</LineItem>
</OrderHeader>
</Order>



There is a single incoming order header, but mutiple LinItems within the
order header. THe map contains a single scripting functoid that checks
whether the ItemID is available in stock and if NOT then he individual
lineitem is marked as CANCEL. This mapping works fine. The problem is that
whenever any line item is maked as CANCEL then the entire order must be
marked as CANCEL. Is there any way to assign the value CANCEL to the
<CANCELSTATUS> element if any LineItem is marked as CANCEL? I cannot get this
to work because it always wants to create mutiple CANCELSTATUS elements.

Of course, what I would love to do is to promote the property inside of
LineItem and that would allow me to do this all in orchestration whithout
even using a map, but we cannot promote a property that is in a Mutiple
Occurs record.


thanks for any help

Charles

Denis Demont

2004-11-22, 5:48 pm

Hello,

you need to create a variable in your xslt to store your LineITem.

When you validate your mapping, Biztalk create a xslt and a xml extension
then you modify your xsl with something like :

<OrderHeader>

<!-- create the variable -->
<xsl:Variable name='Items'>
<xsl:for-each select='LineITem'>
<!-- ..... put your xsl ..... -->
<LineITem>
<ItemID>
<Qty>
<Des>
</LineItem>
</xsl:for-each>
</xsl:variable>

<!-- Check if we have a line item with the status Cancel -->
<xsl:if test="msxsl:node-set($Items)/LineItem='CANCEL'">
<CANCELSTATUS>
</xsl:if>

<!-- Copy the line items -->
<xsl:copy-of select="msxsl:node-set($Items)"/>

</OrderHeader>

I hope that i have helped you.
Best Regards
Denis

"Carlos Alberto" wrote:

> Hello all,
>
> I have a map that maps the following:
>
> Incomign Schema
>
>
> <Order>
> <OrderHeader>
> <LineITem>
> <ItemID>
> <Qty>
> <Des>
> </LineItem>
> </OrderHeader>
> </Order>
>
> TO
>
> Outgoing Schema
>
>
> <Order>
> <OrderHeader>
> <CANCELSTATUS>
> <LineITem>
> <ItemID>
> <Qty>
> <Des>
> </LineItem>
> </OrderHeader>
> </Order>
>
>
>
> There is a single incoming order header, but mutiple LinItems within the
> order header. THe map contains a single scripting functoid that checks
> whether the ItemID is available in stock and if NOT then he individual
> lineitem is marked as CANCEL. This mapping works fine. The problem is that
> whenever any line item is maked as CANCEL then the entire order must be
> marked as CANCEL. Is there any way to assign the value CANCEL to the
> <CANCELSTATUS> element if any LineItem is marked as CANCEL? I cannot get this
> to work because it always wants to create mutiple CANCELSTATUS elements.
>
> Of course, what I would love to do is to promote the property inside of
> LineItem and that would allow me to do this all in orchestration whithout
> even using a map, but we cannot promote a property that is in a Mutiple
> Occurs record.
>
>
> thanks for any help
>
> Charles
>

Bryan Brouckaert

2004-11-24, 5:52 pm

Hello,

Is your custom made functoid a cumulative functiod? I don't think so. If
you change it to a cumulatie functoid, it will solve your problem. There is
a example in the BizTalk SDK.

Like the documentation says, a cumulative functoid has 3 stepts, some closer
explenation in your case.

1 = global init: create a boolean array to store the line results
2 = line calc: use the same .Net code as now and add the resulst too the
array
3 = global result: combine the results of the array.

You see? It is rather simple if you know how a cumulative functoid works
ofcourse.

Greetings,
Bryan.


"Carlos Alberto" <CarlosAlberto@discussions.microsoft.com> schreef in
bericht news:F5533968-206F-4162-BF46-37C3FAA2B14A@microsoft.com...
Hello all,

I have a map that maps the following:

Incomign Schema


<Order>
<OrderHeader>
<LineITem>
<ItemID>
<Qty>
<Des>
</LineItem>
</OrderHeader>
</Order>

TO

Outgoing Schema


<Order>
<OrderHeader>
<CANCELSTATUS>
<LineITem>
<ItemID>
<Qty>
<Des>
</LineItem>
</OrderHeader>
</Order>



There is a single incoming order header, but mutiple LinItems within the
order header. THe map contains a single scripting functoid that checks
whether the ItemID is available in stock and if NOT then he individual
lineitem is marked as CANCEL. This mapping works fine. The problem is that
whenever any line item is maked as CANCEL then the entire order must be
marked as CANCEL. Is there any way to assign the value CANCEL to the
<CANCELSTATUS> element if any LineItem is marked as CANCEL? I cannot get
this
to work because it always wants to create mutiple CANCELSTATUS elements.

Of course, what I would love to do is to promote the property inside of
LineItem and that would allow me to do this all in orchestration whithout
even using a map, but we cannot promote a property that is in a Mutiple
Occurs record.


thanks for any help

Charles


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com