Another Map Question

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Another Map Question

Viewing 0 reply threads
  • Author
    Posts
    • #16825

      Hello all,

      Believe me, the problem is not as scary as it sounds – it just like a detailed explanation…

      I have a flat file schema (just a list of comma delimited values repeated for each record on each line – each record is the same format). What I'm doing involves looping. Taking a subset of my problem domain, the input fields present themselves in pairs.

      Input: LegacyID1,Legacy1,LegacyID3,Legacy3,LegacyID3,Legacy3

      LegacyID1 is a type code, and Legacy1 is a corresponding value. LegacyID1 won't exist without Legacy1, AND vice versa. The same thing goes for the LegacyID2/Legacy2 pair and the LegacyID3/Legacy3 paris. Pairs 2 and 3 are optional. For example, the input record could look like one of the following:

      1C,334058,1C,W22192,1D,769475
      or
      1C,334012,1D,476600,,,
      or
      1D,1618735,,,,

      What I need to do is loop through the input (a flat file schema) and make a repeating group of <Repeated> nodes that look like this (keep in my that my destination schema is fixed – it was supplied to me):

      <Repeated>
       <PIDNumbers ID="1C" MyValue="334058" />
      </Repeated>
      <Repeated>
       <PIDNumberss ID="1C" MyValue="W22192" />
      </Repeated>
      <Repeated>
      <PIDNumbers ID="1D" MyValue="769475" />
      </Repeated>

      or

      <Repeated>
       <PIDNumberss ID="1C" MyValue="334012" />
      </Repeated>
      <Repeated>
       <PIDNumbers ID="1D" MyValue="476600" />
      </Repeated>

      or

      <Repeated>
       <PIDNumbers ID="1D" MyValue="1618735" />
      </Repeated>

      respectively.

      I have no problem writing the loop which creates the correct number of <Repeated> nodes based on the number of IDs in the input file. If use a loop on LegacyID1,LegacyID2,LegacyID3 and place conditions on LegacyID2 and LegacyID3 checking for length > 0 this works. I can also correctly populate the "ID" attributes by just linking LegacyID1,LegacyID2,LegacyID3 to my destination atrributte. The problem I'm having is correctly populating "MyValue" attribute along with it. If I do the same thing I did with LegacyID1,LegacyID2,LegacyID3 and just link Legacy1,Legacy2,Legacy3 to my other destination attribute – it just takes the last one no matter how many <Repeated> nodes I have (even if it is not supplied). Not what I want. What I need is to have Legacy1 go along with LegacyID1, and, IF AND ONLY IF LegacyID2 exists, create another <Repeated> node, and populate it with LegacyID2 and Legacy2 values. Same goes for the third.

      Any help would be greatly appreciated. (I can e-mail screen shot of map as it stands, if you like).

      Chris

Viewing 0 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.