Stephen W. Thomas BizTalk Blog

100% Pure BizTalk
posts - 130, comments - 139, trackbacks - 438

My Links

News

Subscribe to my blog via:


Add to Google

Visit my website at:
www.BizTalkGurus.com

Archives

BizTalk 2004 Samples

BizTalk 2006 Samples

BizTalk Videos

BizTalk White Papers

BizTalkBlogs.com

Great BizTalk Blogs

Other Links

Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

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 message of 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.

SC

 

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. 

 

Print | posted on Thursday, June 16, 2005 10:59 PM |


Feedback

# Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

Impresive! from Steve W Thomas:
For starter, why would you want to call a Receive Pipeline from within... 6/17/2005 3:36 AM | David Hurtado's Integration Trac

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

Excellent sample! 6/27/2005 11:43 AM | Deepak Lakshmanan

# BizTalkGurus.com

BizTalkGurus.com 7/5/2005 1:15 AM |

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

Hmmm nice to have this in BT2006

If they also would figure something out that will allow you to map on context as well it would really be nice...... 7/5/2005 4:40 AM | Patrick Wellink

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

Nice sample, thanks 7/31/2005 10:08 AM | BA

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

By the way, sample works fine with the beta 1 version of BizTalk 2006.
7/31/2005 10:13 AM | BA

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

Nice! What are your options for doing the same in BizTalk 2004? I am looking for a comparison of this new feature to the other approaches. Thanks! 10/13/2005 11:33 AM | Sam

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

It is very difficult / near impossible to directly call a pipeline from an Orchestration in 2004.

I think GotDotNet has a LoopBack Adapter that can be called to pass a message out and return it again after it has been processed by a pipeline.

Hope this helps.

Stephen W. Thomas
10/13/2005 11:53 AM | Stephen W. Thomas

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

I don't see where the schemas are applied to do the debatching . . . 12/26/2006 10:06 AM | Dave

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

If I remember right, the message type matches a deployed Envelope Schema.

So the Xml Disassembler takes care of all the debatching for us with little effort. 12/27/2006 6:27 AM | Stephen W. Thomas

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

You said the reason you would use this would be "I can find it useful in debatching Scenarios that require mapping..". Usually we would loop through each message using count of transactions and transform source into destination message. do you think this solution would be any faster? 3/11/2008 10:47 PM | Swati

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

Probably not. But it might support large groups of files. You would need to run some tests to find out.

Stephen W. Thomas
3/12/2008 8:45 PM | Stephen W. Thomas

# re: Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006


Nice example! 6/17/2008 4:14 AM | vani

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 1 and 4 and type the answer here:

Powered by: