Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Looping on a Sequence or Choice Group?

193 views
Skip to first unread message

Bruce

unread,
Mar 26, 2009, 4:36:01 PM3/26/09
to
I'm having diffficulty trying to figure out a how to loop on a sequence
group. I'm migrating an old translator into BizTalk 2006R2, and the output
has to match the current xml output (destination) file.

Here's an XML snippet:
<ORDER>
<ORDER_LINE>
<ORDER_NOTE>
...
</ORDER_NOTE>
<PeopleSoftMessage>
...
...
</PeopleSoftMessage>
<ORDER_NOTE>
...
...
</ORDER_NOTE>
<PeopleSoftMessage>
...
...
</PeopleSoftMessage>
<ORDER_SomethingElse>
...
</ORDER_SomethingElse>
<PeopleSoftMessage>
...
</PeopleSoftMessage>
<ORDER_LINE>
</PeopleSoftMessage>
<ORDER>
</PeopleSoftMessage>

Effectively there's a <PeopleSoftMessage> tag after every record. The
records themselves may be optional, which would imply that the PeopleSoft
message isn't required as well. The PeopleSoftMessage is exactly the same
throughout.

What I have been able to do it get a schema to validate the legacy files.
However I'm not sure it's the proper way to go, since I have been unable to
properly map the results I'm looking for. This schema is in the destation
part of the map.

I've created a schema which has a sequence group under the ORDER_LINE
record. Within the sequence group, I've created a Choice group and the
PeopleSoftMessage record at the same level (siblings). Within the Choice
Group I've placed the ORDER_NOTE and ORDER_SomethingElse records.

It looks like this:
<ORDER>
<ORDER_LINE>
<Sequence>
<Choice>
. (elements)
.
.
<ORDER_NOTE> (Choice record)
<ORDER_SomethingElse> (Choice record)
<PeopleSoftMessage> (Sequence Record)

I'm able to properly get output for records that aren't optional/choice, so
I don't see that part as an issue.

I've set the Max Occurs for Sequence set to unbounded, Choice is set to 1.
So what I'm trying to convey is "for each record/choice, make sure you have a
sibling PeopleSoftMessage tag 'attached' to it." This piece, in particular,
is where my difficulty lies.

I hope I've set the scenario well enough to get to the map. The source
schema is an inbound EDI 850 purchase order. The first part is that I need
to loop on all N1Loop segments. The N1 segment is tied to the ORDER_NOTE
destination. I also have to loop on the PO1Loop, which would be tied to the
SomethingElse part.

I realize I'm being lengthy about this, I want to make sure this is
explained well enough.

ANY help/suggestions would be so greatly appreciated!

McGeeky

unread,
Mar 27, 2009, 2:43:39 PM3/27/09
to
I wish the mapper would support looping on a sequence or choice group as i
have faced similar ordering issues previously.

However, BizTalk 2006 R2 does tackle this partly by introducing a new
attribute in the <mapsource> element of the map. Check out this article
http://msdn.microsoft.com/en-us/library/aa561485.aspx, the section titled
"Preserving the Order When Mapping a Repeating Sequence Group ".

Cheers.

McGeeky

"Bruce" <Br...@discussions.microsoft.com> wrote in message
news:1B540121-5416-4E32...@microsoft.com...

Bruce

unread,
Apr 9, 2009, 9:46:12 AM4/9/09
to
I did see a post by eliasen (his posts has helped me in so many ways) dealing
with adding a node to the output of a BizTalk map
(http://blog.eliasen.dk/2006/10/13/AddingANodeToTheOutputOfABizTalkMap.aspx).

Unfortunately my map is too complex to handle this appropriately.

In the end I wrote an external c# component to forcibly add the neccessary
tags. Thanks to all who actively share their BizTalk thoughts and ideas.

Bruce

Jan Eliasen

unread,
Apr 26, 2009, 6:49:00 AM4/26/09
to
On Thu, 9 Apr 2009 06:46:12 -0700, Bruce
<Br...@discussions.microsoft.com> wrote:

>I did see a post by eliasen (his posts has helped me in so many ways) dealing
>with adding a node to the output of a BizTalk map
>(http://blog.eliasen.dk/2006/10/13/AddingANodeToTheOutputOfABizTalkMap.aspx).

Glad my posts are usefull :-)

--
eliasen, representing himself and not the company he works for.

Private blog: http://blog.eliasen.dk

Private email: j...@eliasen.dk

0 new messages