Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Loop, Atomic Transaction
- This topic has 4 replies, 1 voice, and was last updated 9 years, 3 months ago by
community-content.
-
AuthorPosts
-
-
April 15, 2009 at 5:22 PM #22148
Hi ,
I get list of Orders from webservice. I need to parse into each order, check for order if already processed and process each line item and then FTP each order to a location.
Am using the xmlnodelist,xmlnode and xmldocument.So forced use a atomic trasactional scope.
Q1 . So I need to form a message to parse only one orderdetails at a time. unlike my webservice schema returns the complete list of orders. How do I construct the message for each order.
Q2 . Also using atomic transaction scope means I cannot use send and receive to FTP my each Order. How do we handle such situations in biztalk.
Thanks,
Integration_newbee
-
April 16, 2009 at 8:04 AM #22152
You shouid consider using the xpath function, along with the position() xpath function.
Initialize a variable to contain the number of items:
nbItems = System.Convert.ToInt32(orderMsg, “count(//*[local-name()=’item’ and namespace-uri()=’ns’)”);
Then, initialize a counter:
itemcounter = 1;
In a loop, while itemcounter <= nbItems
Use another xpath expression to extract the item information. For instance, suppose your item has only one information, the item description:
itemDesc = xpath(orderMsg, “//*[local-name()=’item’ and namespace-uri()=’ns’ and position() ='” +itemcounter + “‘]”);
Increment itemcounter before the next loop.
That way, you won’t have to use an atomic scope.
Another way would be to treat your order as an envelope and each item as a separate document, disassemble it in a pipeline and process it in a sequential convoy.
-
April 17, 2009 at 2:32 PM #22163
how do you use the xpath() in biztalk 2006. I don’t see it available. Am I missing any reference or any component
-
-
April 17, 2009 at 4:15 PM #22165
You can use pipline XML dissassembler component to parse the order list into individual orders. You can call the receive pipeline from the orchestration to achieve this.
Here is an example to help you:
http://geekswithblogs.net/sthomas/archive/2005/06/16/44023.aspx
Also if you are not concerned about the order of processing each orders, use can use a Start Orchestration Shape and use Send/Receive request to FTP server in the called orchestration. Make sure the called orchestration should not be Atomic.
Let me know if it helps.
-
April 21, 2009 at 10:55 AM #22181
Thank you for providing the right direction. I now parse thru using xpath and use position() . I also have the pipeline for FTP transfer. but am struck at one point.
After I take each item, i need to transform that order to a format compatible with my pipeline schema. I have the transform in a construct message for this.
This transform results in a empty xml document jus with nodenames and namespace. I can see that the input message to this transform is perfectly correct. Both input and output messages for this transform have the namespaces defines.
Any help appreciated.
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.