I'm currently working on a BizTalk implementation in which I need to split an incoming message. So far the only examples I've been able to find make use of an envelope schema that would create one message per child node of the incoming message.
However in the message I'm getting, that won't simply suffice. I need to split the message so that all child records with the same identifier becomes one message.
Simplified, the inbound message looks like this:
<Root>
<Child>
<ID>1</ID>
</Child>
<Child>
<ID>1</ID>
</Child>
<Child>
<ID>2</ID>
</Child>
<Child>
<ID>2</ID>
</Child>
</Root>
However obviously with more data than just an ID. What I want is to split this into the same structure, but generate one message per ID, so the result would look like so:
Message 1
<Root>
<Child>
<ID>1</ID>
</Child>
<Child>
<ID>1</ID>
</Child>
</Root>
Message 2
<Root>
<Child>
<ID>2</ID>
</Child>
<Child>
<ID>2</ID>
</Child>
</Root>
In addition to this, I can not be sure that the IDs will follow incrementally, but they might as well be scrambled across the message. Also there's no min or max occurs of an ID; there might be one, there might be 50.
So my question is as follows: How do I solve this in the best possible way? Can I use envelopes for such an "advanced" debatching procedure, do I need to create a custom pipeline component, or are there any other secrets out there? ;)
Thanks in advance!