What I am about to describe will not be new to a lot of you, in fact BizTalk Bill suggested this technique a users group meeting. The fact is, that before Christmas I could find no documentation on it in my usual trawling of the blogosphere to see if there was a more elegant way with BizTalk 2004 to employ envelope splitting inside an Orchestration … I couldn’t find one. So I’m going to spell it out for you here.
Before Christmas I was looking into a way of receiving a large amount of data from a retail head office system applying some business process logic on that data as a whole before splitting that data up into individual messages i.e. one message per retail branch. I had quite good control over the validity of the xml from the head office so I was (with aggressive testing) quite sure there wouldn’t be individual records which would fail during validation or transformation. As we were dealing with quite high transaction volumes here I wanted to produce a message for each branch ~400 with as little overhead as possible = Envelope Splitting. The system was likely to be rolled out in BizTalk 2006 soon after go-live so I also wanted to allow for possible easy employment of BizTalk 2006’s really cool recoverable interchange processing and failed message routing functionality.
But hey I’m using BizTalk 2004 and I’m in an orchestration the answer is folks to either:

1.      Convince the powers that be to move to BizTalk 2006 (I tried)

2.      Write the HO message to disk and then read it off disk through a default xml receive pipeline or your own custom pipeline specifying the envelope schema in an xml disassembler component (better than the default xml receive pipeline for schema versioning) and there you have it individual branch messages.

3.     Same as 2 but instead of writing it to disk (you may not want to do this for security, scalability, async processing reasons) write it to an MSMQT queue and then read it off the queue through the receive pipeline which splits the message.

4. See correspondance with Tom Beerley below on how to achieve this using a loopback adapter, thanks Tom!

Hope this helps simple aye

R. Addis