With the release of BizTalk 2006 Beta just around the corner, why not get a head start by seeing how to call a Receive Pipeline from within an Orchestration.
For starter, why would you want to call a Receive Pipeline from within an Orchestration? I had to struggle for a bit to come up with a good reason… I can find it useful in debatching Scenarios that require mapping prior to debatching or for debatching into smaller batches using a map. I could also find it useful when working with flat file.
Limitations: Calling a Receive Pipeline inside the Orchestration does not support recoverable interchanges (more on this later) and it must be run inside an Atomic Scope.
Super Cool: Supports receiving multiple messages returned from the pipeline and can use enumeration to process each message.
The sample shown below receives a messageof type XmlDocument into the Orchestration. A Receive Pipeline is called to Debatch the message using an Envelope Schema. A loop shape is used to enumerate over the resulting messages and send each single message. In addition, references are needed to Microsoft.XLANGs.Pipeline and
Microsoft.BizTalk.Pipeline.
The CallPipeline Expression Shape contains the following line of code:
InputPipeline = Microsoft.XLANGs.Pipeline.
XLANGPipelineManager.ExecuteReceivePipeline
(typeof(CallReceivePipeline.ReceivePipeline),msgFullMessage);
With InputPipeline defined as an Orchestration Variable of type Microsoft.XLANGs.Pipeline.ReceivePipelineOutputMessages
GetEachMessage will loop the collection using MoveNext like this:
InputPipeline.MoveNext()
Finally, the single messages are assigned inside the Message Assignment shape like this:
msgSingle = new System.Xml.XmlDocument();
InputPipeline.GetCurrent(msgSingle);
With msgSingle defined as an Orchestration Message of a specific schema type.
It is that simple! In about 5 lines of code the Receive Pipeline can be executed inside on Orchestration in BizTalk 2006!
Download: Sample Receive Pipeline in BT2006
Do not forget to view all my other samples at http://www.biztalkgurus.com
Please note this sample is based on pre-beta code (CTP Build) of BizTalk Server 2006. This may not work on other builds, RTM, etc.
If you do not have Visual Studio 2005 Beta 2 and BizTalk 2006 installed you can still download and view the artifacts (like the Orchestration). You will not be able to open the project or run the sample.
I am struggling to make this work with schema generated by sql adapter. Does this work when receive from SQL?
Hello. Calling a pipeline should work no matter what schema you use or how you receive the data.
If you have additional problems you can try posting a question to the forum.
Stephen W. Thomas
While deploying it throws error, sql server not allowed remote connections. In my env SQL Server located in remote location. So i want to knw is wehre i want to do sql server configuration
Make sure you have the correct SQL Name set up inside your project properties. Also, make sure you are a member of the BizTalk Admin Group and using Domain Accounts (or at least have the correct permissions).
If you were able to configure BizTalk, SQL should already be set up to allow remote connections.
This was a great tutorial, but how would I do this the other way? Take multiple XML files into 1 send file?
to combine multiple files into 1 file – call send pipeline to aggregate messages in orchestration.