Friday 15 August 2008

Parallel Branching BizTalk 2006

How to use Parallel Branching in BizTalk 2006

Object : How to use parallel Branching in Biztalk 2006
Solution Name : ParallelCheck
Project Name : ParallelCheck
Map : MapSingle.btm,mapOrderInsertSQL.btm,MapMultipleOrders.btm

The word “Parallel” means two or more activities to be run simultaneously without depend on any other object.
When you talk about technical terms two are more objects to be execute simultaneously.

In this example I created an Order form, which can have Single Order details or Multiple Order details. However for each order I need to track the Order data and store into my SQL Table.

For each Single Order form it creates a Complete Order from output file with “Single” as extension and for each multiple order form it creates a Complete Order form output file with “Multiple” as extension. Apparently for each Single and Multiple orders I am trying to track the order details and storing the data in SQL Table. The table structure as defined below.





When ever it receives a Order from the orchestration Parallel branch checks the Orders count and executes the branch accordingly.

You need to write the below sample code for counting the Orders.
OrderCount= System.Convert.ToInt16(xpath(InputOrderMsg,"count(/*[local-name()='Root' and namespace-uri()='http://ParallelCheck.Orders']/*[local-name()='OrderDetails' and namespace-uri()=''])"));

If the form contains only 1 order details then the parallel branch quickly runs into Single Order process branch and performs the action and if order count is 2 or more it goes to Multiple Order Branching.

Simultaneously Track Order branch will execute for each Single or multiple branch executions, and it performs a SQL Insert action using SQL Send port.




For better understanding of how to work with SQL Receive and send port, check the below links
http://rajwebjunky.blogspot.com/2008/02/biztalk-sql-adapter.htmlhttp://rajwebjunky.blogspot.com/2008/06/working-with-sql-adapter-receiveport-4.html







Download the Source code :


If you need any more clarifications, reach me @ raj.webjunky@yahoo.com.

No comments:

Post a Comment