开发者

Biztalk looping functoid behavior

开发者 https://www.devze.com 2023-02-25 13:54 出处:网络
Good morning, I\'m trying to learn BizTalk and it\'s doing something I don\'t understand. I\'m outputting XML for employee addresses. A looping functoid creates two \"Communication\" elements. I exp

Good morning,

I'm trying to learn BizTalk and it's doing something I don't understand.

I'm outputting XML for employee addresses. A looping functoid creates two "Communication" elements. I expected to see the "CountrySubDivisionCode" as child elements in BOTH of them but they appear only once:

<ns0:Communication sequence="1">
    <ns0:ChannelCode>Telephone</ns0:ChannelCode>
    <ns0:UseCode>Personal</ns0:UseCode>
    <ns0:DialNumber>1234567890</ns0:DialNumber>
    <ns0:Address>
        <ns0:AddressLine sequence="1">1234 My St</ns0:AddressLine>
        <ns0:CityName>Some City</ns0:CityName>
        <ns0:CountrySubDivisionCode name="County">Jackson</ns0:CountrySubDivisionCode>
        <ns0:CountrySubDivisionCode name="State">MO</ns0:CountrySubDivisionCode>
        <ns0:CountryCode>US</ns0:CountryCode>
        <ns0:PostalCode>14099</ns0:PostalCode>
    </ns0:Address>
</ns0:Communication>
<ns0:Communication sequence="2">
    <ns0:ChannelCode>Telephone</ns0:ChannelCode>
    <ns0:UseCode>Business</ns0:UseCode>
    <ns0:DialNumber>0987654321</ns0:DialNumber>
    <ns0:Address>
        <ns0:AddressLine sequence="1">1234 My St</ns0:AddressLine>
        <ns0:CityName>Some City</ns0:CityName>
        <ns0:CountryCode>US</ns0:CountryCode>
        <ns0:PostalCode>14099</ns0:PostalCode>
    </ns0:Address>
<开发者_JS百科/ns0:Communication>

The input is a flat schema.

There's one looping functiod for the Communication element with telephone numbers. It's output is the Communication element in the output schema.

There's another looping functoid with state and county inputs, It's output is the CountrySubDivisionCode element in the output schema.

How is the mapping deciding what is output and what is not? Is it not outputting the second set because they would be duplicates? All the tutorials I've found seem to be copy and paste versions of the same source material and it's pretty light.

Thanks


Validate the map (right click in the Solution Explorer) and click on the XSL link in the visual studio output window. This the the best way to figure out what the mapper is doing as you'll see the XSLT that is generated.


I was able to fix this by experimentation. I believe how the looping functoid works is this:

  • it creates a list of input values from each of the inputs
  • It iterates through the list creating one output for each input. When it does this it REMOVES (NOT nulls or empties) the other inputs.
  • Once the list is exhausted there are NO outputs (the list is empty).

I had "nested" looping functoids. The outer functoid had three inputs and the inner functoid had two inputs. On the first outer functoid output it used both of the two inputs from the inner functoid (which were suppressed because of the position and lost). On all subsequent outer functoid outputs the inner functoid had no further values to use so it output nothing.

For my solution I had to rearrange the inputs to the outer functoid so the address portion came first. The inner functoid output the two country divisions correctly. For the subsequent telephone rows there were no remaining outputs and none were desired.

Michael and Mousio thanks for the help!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号