![]() |
Enterprise Systems »
Microsoft BizTalk Server »
General
Intermediate
Parallel Branching and Scoping in BizTalk Orchestrations - Advanced ConceptsBy Naveen KaramchettiThis article explains the various tricky issues in parallel branching in BizTalk Server 2004 Orchestrations. |
C#, XML, Windows, .NET, ASP.NET, Visual-Studio, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
Generally, parallel branching is used when you need to execute different un-related activities simultaneously.
Example 1: In your business process, if you need to call a web service and perform a transform. Since these two activities are un-related, they can be executed in parallel using a "Parallel" shape:
A "scope" is a unit or a block which is executed as a context and is associated with a transaction type. In order words, a scope defines a context which maintains the state for a defined unit-of-orchestration code. If you were to open the *.ODX files in Notepad, you would notice that the scope shape placed in an orchestration would create the following:
scope
{
task
{
// Can be a transform or an expression shape.
}
}
Each scope shape in the orchestration maps to a "scoped" segment of code. A segment defines the boundaries where the control is passed back to the BizTalk engine to persist data in the MessageBox store, thus enabling consistency and durability.
The scope shape in orchestration has two important properties:
true" or "false".
When two scopes in a parallel branch are set to Synchronized="true", then they would be executed independent of each other in such a way that each branch assumes that it is the only one being executed in the system.
When an orchestration variable needs to be shared across several parallel branches, in that case, the scope's synchronization flag must be set to "true" or the 'Transaction Type' must be set to "Atomic".
Note: An orchestration (*.odx) file also has a 'Transaction Type' property.
The classical definition of a transaction is - an atomic unit of work which results in moving the system from one consistent state to a new consistent and durable state. A transaction can either be "committed" or "rolled back" depending on various conditions. Note that a transaction which cannot be rolled back needs to be "compensated". This means that if an operation 'f(x)' has been performed on some data, in order to revert it back we need to perform an operation 'f(y)', which essentially performs an undo operation, this is known as "compensation" in simple terms.
The image above highlights the various key properties to be set for an orchestration.
Note: These properties are applicable only when the 'Transaction Type' is set to 'Atomic'.
true". It may improve performance with the possibility of losing isolation data.
The above image shows two parallel branches whose "synchronized" property is set to "true". The reason being, both the branches set the "CityCode" value, hence the use of shared data.
The message assignment shape "Assigning 10" has the following lines of code:
OutputXMLMessage = InputXMLMessage;
OutputXMLMessage.CityCode = 10;
The message assignment shape "Assigning 20" has the following lines of code:
OutputXMLMessage = InputXMLMessage;
OutputXMLMessage.CityCode = 20;
Line 1: The InputXMLMessage is assigned to OutputXMLMessage.
Line 2: The property CityCode is set to "10" and "20" respectively.
An error message appears, if the synchronized property is not set:
'OutputXMLMessage': if shared data is updated in a parallel
then all references in every task must be in a synchronized
or atomic scope
new System.Timespan(1,0,0,0);
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 14 Mar 2006 Editor: Chris Maunder |
Copyright 2006 by Naveen Karamchetti Everything else Copyright © CodeProject, 1999-2010 Web22 | Advertise on the Code Project |