BizTalk Functoid Mapping Help – How do I handle this senario?

Home Page Forums BizTalk 2004 – BizTalk 2010 BizTalk Functoid Mapping Help – How do I handle this senario?

Viewing 1 reply thread
  • Author
    Posts
    • #20442

       Excuse me if this seems too simple.   I am new to BizTalk.

      Lets say I have source XML document.

      <Fruit>

           <FruitCode>APP</FruitCode>

           <FruitDescription>Apple</FruitDescription>

       </Fruit>

      <Fruit>

           <FruitCode>ORG</FruitCode>

           <FruitDescription>Orange</FruitDescription>

      </Fruit>

       

      The source schema would be

      <xs:element minOccurs=”0″ maxOccurs=”unbounded” name=”Fruit”>

           <xs:complexType>

                <xs:sequence>

                    <xs:element minOccurs=”0″ name=”FruitCode” type=”xs:string”  />

                    <xs:element minOccurs=”0″ name=”FruitDescription” type=”xs:string” />

               </xs:sequence>

           </xs:complexType>

      </xs:element>

      The destination schema looks like the following:

                    <xs:element minOccurs=”0″ maxOccurs=”1″ name=”FruitA” type=”xs:string”  />

                    <xs:element minOccurs=”0″ maxOccurs=”1″ name=”FruitB” type=”xs:string” />

      In the mapper, I was thinking about using an Equal functiod to return true if the FruitCode is APP.  Then use a Value Mapp functiod to return 1 for FruitA.   I would do the same where FruitCode is ORG, but send it to FruitB.     It doesn’t seem to be working.   Am I going in the right direction?

    • #20447

      apreg – what is your desired output from the map (in Xml)?

      • #20449

         

        In some cases, neither Apple or Orange will not show up in the source.  For the cases when the Apple shows up in the source XML and the Orange doesn’t, I want the output XML to display.

        <FruitA>1</FruitA>

        <FruitB>0</FruitB>

        If both are found in the source XML, it would be

        <FruitA>1</FruitA>

        <FruitB>1</FruitB>

        etc

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