November 2005 - Posts

BTS2006 : Splitting Messages using Pipeline from Inside the Orchestraion

I had some Aggregator Orchestration which were running into Zombie situations ,
So when I got the biztalk 2006 beta version I was anxious to try out the new functionality of being able to call your receive
pipeline from inside your Orchestration . You can enumerate through the EnvelopeMessage passed into the recieve pipeline
just like you would enumerate in an ICollection or Recordset using .MoveNext() .

This is how my built Orchestration looked like

I will briefly try to capture the steps that I took

1.) Create a Document Schema SingleOrder.xsd

2.) Create an Envelope Schema TotalOrder.xsd

3.) Create a receive Pipeline SplitOrder.btp

 4.) Add the XML Dissasembler and select the Document and envelope Schemas as above.

5.) Create your Recieve Port and set the document type to your Envelope Schema , This Port now has XMLPassthru transmit , I am calling this message IncomingFullMessage

6.) Now we enter Splitting scope ( Pipelines can only be invoked from Atomic scopes, Also it does not support Recoverable interchange processing when called this way )

7.) Add Microsoft.XLANGs.Pipeline as Reference and then ;declare a variable for the pipeline in my case OrderSplitter AS "Microsoft.XLANGs.Pipeline.ReceivePipelineOutputMessages"

8) In the expression Shape Call Order Splitter , OrderSplitter = Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline(typeof(SplitOrderReceivePipeline),IncomingFullMessage);

9) In the loop Get_Next-Order Shape iterate through each message using OrderSplitter.MoveNext()

10.) Create an Orchestration variable "SingleOrder" of type Document Schema

11.) Create the Single Message you want in the message assignment Shape and set SingleOrder = new System.Xml.XmlDocument(); OrderSplitter.GetCurrent(SingleOrder);

12) Now you have the single Message that you want to process. You can send it to whatever process you want , In this example I am just sending the message to a Output folder.