Friday 26 December 2014

Looping Functoid

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 twoFlowerSurvey 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>

No comments:

Post a Comment