Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Looping in Orchestration

8 views
Skip to first unread message

Aniruddha Surange

unread,
Oct 6, 2009, 11:09:55 AM10/6/09
to
Hello,

I working on Order Management process integration. My input schema is as
follows.

<ns0:Orders xmlns:ns0="http://CheckLooping.iSchema">
<Order>
<OrderHeader OrderNo="OR/CA/08/12" OrderDate="2009-08-11"
CustomerName="Customer A" BillAddress1="Customer A Address 1"
BillAddress2="Customer A Address 2" BillCity="Sterling" BillState="VA"
BillZipCode="20164" ShipAddress1="Customer A Address 1"
ShipAddress2="Customer A Address 2" ShipCity="Sterling" ShipState="VA"
ShipZipCode="20164" />
<OrderDetails ItemCode="I00001" ItemQty="12" />
<OrderDetails ItemCode="I00002" ItemQty="14" />
<OrderDetails ItemCode="I00004" ItemQty="8" />
<OrderDetails ItemCode="I00007" ItemQty="15" />
</Order>
<Order>
<OrderHeader OrderNo="OR/CA/08/17" OrderDate="2009-08-19"
CustomerName="Customer A" BillAddress1="Customer A Address 1"
BillAddress2="Customer A Address 2" BillCity="Sterling" BillState="VA"
BillZipCode="20164" ShipAddress1="Customer A Address 1"
ShipAddress2="Customer A Address 2" ShipCity="Sterling" ShipState="VA"
ShipZipCode="20164" />
<OrderDetails ItemCode="I00003" ItemQty="14" />
<OrderDetails ItemCode="I00006" ItemQty="8" />
<OrderDetails ItemCode="I00008" ItemQty="15" />
</Order>
</ns0:Orders>

I will be receiving input message based on the above schema, which may
contain single/multiple orders (OrderHeader Node) and single/multiple items
(OrderDetails Nodes). I want to first loop thru the orders and insert them
into the database and get the OrderId from database using SQL Adapter (SQL
Stored Procedure), within order loop I want to loop thru items of that order
and insert them into the database with the OrderId received.

I tried XPath approach but unable to achieve the desired results.

Do anybody suggest me the way to achieve it.

Thanks in advance.

Aniruddha


nenzax

unread,
Oct 6, 2009, 1:02:01 PM10/6/09
to
Jan Tielens has a pretty cool article on how to achieve this, well not
a 100% fit for your problem but this will help you get started.

http://weblogs.asp.net/jan/archive/2004/03/07/85259.aspx
http://weblogs.asp.net/jan/archive/2004/03/07/85259.aspx

Aniruddha Surange

unread,
Oct 7, 2009, 7:18:41 AM10/7/09
to
Thanks for your help. I will give it a try.

"nenzax" <madhu...@gmail.com> wrote in message
news:de9b45d2-afd9-47de...@u16g2000pru.googlegroups.com...

Aniruddha Surange

unread,
Oct 8, 2009, 4:39:52 AM10/8/09
to
I tried as per the instructions given by Jan Tielens but still not able to
send the debatched message to SQL Adapter and receive the response from
there.

"nenzax" <madhu...@gmail.com> wrote in message
news:de9b45d2-afd9-47de...@u16g2000pru.googlegroups.com...

Daniel S

unread,
Oct 9, 2009, 2:09:15 PM10/9/09
to
Hello Aniruddha,

Are you debatching the inbound message in the pipeline using an
envelope? Once this is done, each orchestration instance can receive
a single order. Now, you can call the operation to insert the order,
then loop through the items. At this point, a simple solution might
be to define the order line item in a separate schema, which is
included in the main Order schema. Then a simple xpath statement to
get a NodeList of the Order Items will allow you to create a new
OrderItem inside the loop (you are looping through the node list), and
send that to your SQL operation to add the order item.

Can you describe what you have in place and what errors you are
encountering? Also let me know if you need any clarification on the
above description.

Thanks,
Dan

On Oct 8, 1:39 am, "Aniruddha Surange" <asura...@gmail.com> wrote:
> I tried as per the instructions given by Jan Tielens but still not able to
> send the debatched message to SQL Adapter and receive the response from
> there.
>

> "nenzax" <madhugi...@gmail.com> wrote in message


>
> news:de9b45d2-afd9-47de...@u16g2000pru.googlegroups.com...
>
>
>
> > Jan Tielens has a pretty cool article on how to achieve this, well not
> > a 100% fit for your problem but this will help you get started.
>
> >http://weblogs.asp.net/jan/archive/2004/03/07/85259.aspx

> >http://weblogs.asp.net/jan/archive/2004/03/07/85259.aspx- Hide quoted text -
>
> - Show quoted text -

Aniruddha Surange

unread,
Oct 12, 2009, 3:39:18 AM10/12/09
to
Hi Daniel,

Yes, I am doing exactly what you describe. The problem starts when I tried
to merge message received from the SQL operation upon inserting the order
(it contains OrderId of the inserted order) and orderitem message. It gives
me XmlException "Root element is missing".

Thanks

Aniruddha S

"Daniel S" <danie...@gmail.com> wrote in message
news:5f0ea3a5-a579-48b0...@g3g2000vbr.googlegroups.com...

Paul Somers

unread,
Nov 2, 2009, 7:38:01 AM11/2/09
to
Hi,

There is a sample in BTS 2006 R2 onwards, in the SDK folder of biztalk,
under pipelines, of doing this using the new xlang components exposed for
this purpose.

Jeeessseeee

unread,
Mar 16, 2010, 7:58:48 AM3/16/10
to

"Aniruddha Surange" <asur...@gmail.com> wrote in message
news:uHQtPcpR...@TK2MSFTNGP02.phx.gbl...

KK

unread,
Mar 18, 2010, 6:39:02 AM3/18/10
to
Hi,

The best way would be pass all details header and line items at once to your
stored proc and execute insert @ database.

Refer:
http://www.eggheadcafe.com/software/aspnet/30066352/return-value-from-stored.aspx

"Jeeessseeee" wrote:

> .
>

0 new messages