Functoid

Viewing 1 reply thread
  • Author
    Posts
    • #16840

      Hi,

      Is there any good document about Functoid? I want to learn how to use.

      I want to know how to concatenate looping string in a element. I have a element in my schema, it can loop up to 50. I want to concatenate all those string and map it to sql schema. Here i will get only one input element. I tried String Concatenation Functoid. No luck. I dont know where I am making mistake.

      Any help?

      Siva

    • #16844

      You need to use Cumulative Concatenate Functiod.

      Hope you find it useful.

      • #16846

        Or you can use the scripting functoid with Inline XSLT

        <outputNode>
        <xsl:for-each select="repeatingNode">
        <xsl:value-of select="."/>
        </xsl:for-each>
        <outputNode>

      • #16855

        Hi,

        Thank you for your help.

        I tried Cumulative Concatenate Functoid. I am getting wrong out put.

        Look at my schema

        |-Detail
          |-Detail01
            |-POId
            |-PatnerId   
          |-Detail02
            |-Msg

        Detail can occure o – 100 times. Detail02 can occure 0- 50 times for each Detail01.

        Let Say my input schema is:

        <Detail>
           <Detail01>
               <POId> 552233 </POId>
               <PartnerId> IBM_Lenovo </PartnerId>
           <Detail02>
               <Msg> PC – Dul Core</Msg>
           </Detail02>
           <Detail02>
               <Msg> 250GB Hardrive, 2G Mem </Msg>
           </Detail02>
           </Detail01>
           <Detail01>
               <POId> 552235 </POId>
               <PartnerId> CISCO </PartnerId>
           <Detail02>
               <Msg> Network Card</Msg>
           </Detail02>
           <Detail02>
               <Msg> Via Purelator Please</Msg>
           </Detail02>
           </Detail01>
         </Detail>

        I want to concatenate each MSG for their POIds. If I use Cumulative Concatenate Functoid, I am getting the out put :
        " PC – Dul Core 250GB Hardrive, 2G Mem Network Card Via Purelator Please"

        I want the out put : "PC – Dul Core 250GB Hardrive" and "2G Mem Network Card Via Purelator Please". So I can store those msg in the table related to their POId.

        Any help?

        Siva

      • #16856

        Hi,
        Thank you for your help.
        I tried Cumulative Concatenate Functoid. I am getting wrong out put. Look at my schema

        |-Detail
          |-Detail01
            |-POId
            |-PatnerId   
          |-Detail02
            |-Msg

        Detail can occure o – 100 times. Detail02 can occure 0- 50 times for each Detail01.
        Let Say my input schema is:

        <Detail>
           <Detail01>
               <POId> 552233 </POId>
               <PartnerId> IBM_Lenovo </PartnerId>
           <Detail02>
               <Msg> PC – Dul Core</Msg>
           </Detail02>
           <Detail02>
               <Msg> 250GB Hardrive, 2G Mem </Msg>
           </Detail02>
           </Detail01>
           <Detail01>
               <POId> 552235 </POId>
               <PartnerId> CISCO </PartnerId>
           <Detail02>
               <Msg> Network Card</Msg>
           </Detail02>
           <Detail02>
               <Msg> Via Purelator Please</Msg>
           </Detail02>
           </Detail01>
         </Detail>

        I want to concatenate each MSG for their POIds. If I use Cumulative Concatenate Functoid, I am getting the out put :
        " PC – Dul Core 250GB Hardrive, 2G Mem Network Card Via Purelator Please"

        I want the out put : "PC – Dul Core 250GB Hardrive" and "2G Mem Network Card Via Purelator Please". So I can store those msg in the table related to their POId.

        Any help?

        Siva

      • #16857

        Thank you NISHIL,

        I am getting wrong answear when i use cumulative Concatenat Functoid.

        I want to concatenate elment input which is looping under the another main loop.

        When I use Cumulative Concatenate Functoid, I am getting same out put for all main loops. I tried to post example but this website didnt allow me to post it.

        for example, I have 3 Purchase Order info in the schema. Each PO can have 0 -50 Msg in it. I want to combine msgs for the PO.

        Thank you in advance

        • #16866

          Well Siva as per my understanding you need to use a custom XSLT in your MAP.I tried it in the test environment and here are the results.

          Input File:

          <Detail>
             <Detail01>
                 <POId> 552233 </POId>
                 <PartnerId> IBM_Lenovo </PartnerId>
             <Detail02>
                 <Msg> PC – Dul Core</Msg>
             </Detail02>
             <Detail02>
                 <Msg> 250GB Hardrive, 2G Mem </Msg>
             </Detail02>
             </Detail01>
             <Detail01>
                 <POId> 552235 </POId>
                 <PartnerId> CISCO </PartnerId>
             <Detail02>
                 <Msg> Network Card</Msg>
             </Detail02>
             <Detail02>
                 <Msg> Via Purelator Please</Msg>
             </Detail02>
             </Detail01>
           </Detail>

          Output File:

            <RootNodeOutput>
          <Detail>
            <POID>552233</POID>
            <MSG>PC – Dul Core 250GB Hardrive, 2G Mem</MSG>
            </Detail>
          <Detail>
            <POID>552235</POID>
            <MSG>Network Card Via Purelator Please</MSG>
            </Detail>
            </RootNodeOutput>
          ———————————————————————
          XSLT Used:
          <?xml version="1.0" encoding="UTF-16"?>
          <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0" >
            <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
            <xsl:template match="/">
              <xsl:apply-templates select="/Detail" />
            </xsl:template>
           
           <xsl:template match="/Detail">   
            <RootNodeOutput>  
            <xsl:for-each select="Detail01">
                  <Detail>      
             <xsl:variable name="tempMSG">
              <xsl:for-each select="Detail02">
               <xsl:value-of select="Msg/text()" />
              </xsl:for-each>
             </xsl:variable>
                    <POID>         
                      <xsl:value-of select="POId/text()" />
                    </POID>   
                    <MSG>    
              <xsl:value-of select="$tempMSG" />    
              </MSG>
                  </Detail>
                </xsl:for-each>
              </RootNodeOutput>
            </xsl:template>
          </xsl:stylesheet>
          Hope you find it Useful.
          • #16885

            Thank you NISHIL,

            I never used XSLT before. According to your xslt it will create a XML (so it will create fields and store the value for them).

            In my case, I want to use this inside the Map. I already have these fields in my map (Destination side).

            I think i have to get these values from source and store then in destination fields. But I dont know how to do that. I am new to BizTalk.

            Do you know any tutorial or documents where I can learn this kind of stuff?

            Thank you,

            Siva

            • #16889

              You can use this xslt inside your map in biztalk.

              Create a new map. Make your source and destination schemas the same and in the map properties add your XSLT in the “Custom XSLT path” setting. The output should give you an XML document free of extra nodes and a map free of extra functoids.

               

               

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