Singleton Orchestration in BizTalk Server
page 5 of 6
by Naveen Karamchetti
Feedback
Average Rating: 
Views (Total / Last 10 Days): 11791/ 259

Scenario: Memo Processing Example

In this example a Memo input is sent to the orchestration. The Memo message is of two kinds, "Memo.xml" and an "EndMemo.xml" (Flag is set to STOP).

NOTE: The EndMemo signifies the end-of-batch signal.

1.    When the first Memo arrives at the receive location, a new instance of the Orchestration is created with the Correlation Set as the Receive Port name.

2.    All other messages which arrive at the same Receive port would have the same Correlation set and would use the same instance of the Orchestration.

3.    When an "EndMemo.xml" arrives into the Orchestration an exception is thrown by the orchestration and the Orchestration state becomes “Suspended (non-resumable).” All other messages which arrive after the “EndMemo.xml” will not be processed. When this Orchestration instance is terminated it gets into “Completed with Discarded Messages” state. In this case the Orchestration needs to be terminated.  The entire set of messages which were not processed in this case needs to be resubmitted again.

4.    The Logic has to be written in such a way so as to Terminate the Orchestration in the case where a EndMemo arrives.

5.    After the “Suspended Orchestration” is terminated, a new instance of the Orchestration is created once a message arrives at the receive location. This Orchestration will continue to process new messages placed at the receive location until an EndMemo.xml arrives, which again suspends the orchestration.

6.    Thus, in the case of a “Singleton Orchestration” a suspended non-resumable Orchestration needs to be terminated, in order to process all the backlog messages. The messages which were not processed also need to be resubmitted again.

Quick Summary: A memo message arrives at the receive location, which creates an instance of the orchestration. The second receive shape picks up the rest of the messages from the receive location, using the same orchestration instance created.

Figure 2 - Orchestration Screen Shot

Quick Takeaways

·         Observe that the same logical Receive Port is used for both the Receive shapes.

·         Observe the while LOOP which looks for the flag in the messages and terminates the Orchestration once an End Memo is received.

·         The use of Correlation type enables a Singleton Orchestration which requires a property or a set of properties to be common across a set a messages.

 


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 8 and 1 and type the answer here:

User Comments

Title: Demo   
Name: Author
Date: 12/3/2008 1:56:46 PM
Comment:
Delay is just for demo only. You are free to remove.
Title: Why the delay?   
Name: Adman
Date: 1/28/2008 12:11:43 PM
Comment:
What's the purpose of the delay? If you leave out a delay, why are lots of CPU cycles used...?

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 12/3/2008 7:31:29 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search