|
Home > Archive > BizTalk Server General > October 2004 > Mapping - one order line-item in - two out - is it possible?
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 |
Mapping - one order line-item in - two out - is it possible?
|
|
| Neal Walters 2004-10-28, 5:49 pm |
| In a hierarchical relation (such as order to order-line-item), is it possible
to take one order-line-item on the incoming XML and product two
order-line-items on the outgoing XML. It seems like I remember reading of a
functoid that would do this in 2002, but can't find it in 2004.
In our case, we receive an order from Amazon that has gift wrap included in
individual line items. In our internal system, we treat gift wrap as a
separate line item. So we need to take one line-item coming in and otuput
two line-items.
If there is no functoid, what about XSLT? Or should I write a .NET program
and use DOM?
Thanks in advance,
Neal Walters
http://Biztalk-Training.com - Free Biztalk Demos
| |
| Stephen W. Thomas 2004-10-28, 5:49 pm |
| I have done this using both the table looping functoid and inline XSLT
template call.
The table looping works well if you always have 2 lines, never more. XSLT
gives you a little more flexibility.
I have samples of both. I will post them to my blog later tonight.
Stephen W. Thomas
http://www.geekswithblogs.net/sthomas
"Neal Walters" wrote:
> In a hierarchical relation (such as order to order-line-item), is it possible
> to take one order-line-item on the incoming XML and product two
> order-line-items on the outgoing XML. It seems like I remember reading of a
> functoid that would do this in 2002, but can't find it in 2004.
>
> In our case, we receive an order from Amazon that has gift wrap included in
> individual line items. In our internal system, we treat gift wrap as a
> separate line item. So we need to take one line-item coming in and otuput
> two line-items.
>
> If there is no functoid, what about XSLT? Or should I write a .NET program
> and use DOM?
>
> Thanks in advance,
> Neal Walters
> http://Biztalk-Training.com - Free Biztalk Demos
>
| |
| Stephen W. Thomas 2004-10-29, 2:47 am |
| I posted a sample that takes an order item and evaluates the <GW> node for
“Y” (meaning the item is gift wrapped). If it is “Y” two line items are
created on the output rather then one. This uses the <xsl:choose> and
<xsl:for-each> XSLT element. You can get the download here:
http://www.geekswithblogs.net/sthom...0/28/13982.aspx
I wasn’t able to get it to work correctly with the Table Looping Functoid
since I assume the total number of line items in the order will not be known
ahead of time.
If you have problem accessing it or if this will not work for you, please
let me know.
Stephen W. Thomas
http://www.geekswithblogs.net/sthomas
"Neal Walters" wrote:
> In a hierarchical relation (such as order to order-line-item), is it possible
> to take one order-line-item on the incoming XML and product two
> order-line-items on the outgoing XML. It seems like I remember reading of a
> functoid that would do this in 2002, but can't find it in 2004.
>
> In our case, we receive an order from Amazon that has gift wrap included in
> individual line items. In our internal system, we treat gift wrap as a
> separate line item. So we need to take one line-item coming in and otuput
> two line-items.
>
> If there is no functoid, what about XSLT? Or should I write a .NET program
> and use DOM?
>
> Thanks in advance,
> Neal Walters
> http://Biztalk-Training.com - Free Biztalk Demos
>
| |
| Neal Walters 2004-10-29, 5:49 pm |
| Stephen,
Thanks a million! That is the best answer I've ever receive on this
forum - complete working examples and a blog even!!!
Someone here also suggested using the xslt copy statement, but I have not
investigated yet.
My map is already fairly complex. I'm planning to take the output map,
and actually do another map so I can keep the complexity of the line-item
duplications separate from all the other functoids I already have.
Neal Walters
http://Biztalk-Training.com - Free Biztalk Demos
| |
|
| An excellent reply!
I looked at the sample and I had a slightly simpler interpretation of the
output format, that being to simply add lines to the lines on the original
order. I don't know what Neal's requirement was... If that is the case then
the table looping functoid has the potential to handle this. You just connect
the item line in the source to the table looping functoid and connect it to
the item in the output. Add one row for the main item and additional rows for
each extra item you need to create. The first column should be from a logical
functoid (e.g. existence) and the gated flag should be set.
of course it all depends upon what output format is required.
mark
It can easily handle more than 2 items, although you must know in advance
what they could be.
"Stephen W. Thomas" wrote:
[vbcol=seagreen]
> I posted a sample that takes an order item and evaluates the <GW> node for
> “Y” (meaning the item is gift wrapped). If it is “Y” two line items are
> created on the output rather then one. This uses the <xsl:choose> and
> <xsl:for-each> XSLT element. You can get the download here:
> http://www.geekswithblogs.net/sthom...0/28/13982.aspx
>
> I wasn’t able to get it to work correctly with the Table Looping Functoid
> since I assume the total number of line items in the order will not be known
> ahead of time.
>
> If you have problem accessing it or if this will not work for you, please
> let me know.
>
> Stephen W. Thomas
> http://www.geekswithblogs.net/sthomas
>
>
> "Neal Walters" wrote:
>
|
|
|
|
|