Microsoft BizTalk Server 2004
Looping Functoid

The Looping functoid combines multiple records or fields in the source schema into a single record in the destination schema.

The following figure shows a Looping functoid used in a map to combine addresses collected from two different surveys into a single master address list.

Looping Functoid Map

The FoodSurvey and FlowerSurvey looping records of the source schema are mapped to the looping Address record of the destination schema. If an input instance message has three FoodSurvey records and two FlowerSurvey records, the Looping functoid combines these to create five Address records in the output instance message.

The following code is a sample input instance message.

<ns0:Surveys xmlns:ns0="http://LoopingFunctoid.Surveys">
    <FoodSurvey Name="Karin Zimprich" Address="345 N 63rd St" City="Boston" State="MA" PostalCode="07485" />
    <FoodSurvey Name="Wendy Wheeler" Address="7890 Broadway" City="Columbus" State="OH" PostalCode="46290" />
    <FoodSurvey Name="Florian Voss" Address="1234 Main St" City="Denver" State="CO" PostalCode="97402" />
    <FlowerSurvey Name="Kelly Focht" Address="456 1st Ave" City="Miami" State="FL" PostalCode="81406" />
    <FlowerSurvey Name="Jim Kim" Address="567 2nd Ave" City="Seattle" State="WA" PostalCode="98103" />
</ns0:Surveys>

This input instance message produces the following output instance message when processed by the map in the preceding figure.

<ns0:MasterAddresses xmlns:ns0="http://LoopingFunctoid.MasterAddresses">
    <Address Name="Karin Zimprich" Street="345 N 63rd St" City="Boston" State="MA" PostalCode="07458"/>
    <Address Name="Wendy Wheeler" Street="7890 Broadway" City="Columbus" State="OH" PostalCode="46290"/>
    <Address Name="Florian Voss" Street="1234 Main St" City="Denver" State="CO" PostalCode="97402"/>
    <Address Name="Kelly Focht" Street="456 1st Ave" City="Miami" State="FL" PostalCode="81406"/>
    <Address Name="Jim Kim" Street="567 2nd Ave" City="Seattle" State="WA" PostalCode="98103"/>
</ns0:MasterAddresses>

Relationships among nodes affect the behavior of the Looping functoid. For example, linking both a child node and its parent in the source schema to the Looping functoid prevents the destination node from being created.

Important  Connecting a functoid to child fields of source nodes of the Looping functoid may produce unexpected results if the source nodes are not siblings.

The Looping functoid is a powerful construct that you can use to create conditional loops and to map schemas to catalogs. There are also some effects of overlapping Looping functoid paths you need to take into account.

This section contains:

To download updated BizTalk Server 2004 Help from www.microsoft.com, go to http://go.microsoft.com/fwlink/?linkid=20616.

Copyright © 2004 Microsoft Corporation.
All rights reserved.
Page view tracker