Discussion Strange mapper behavior

  • Sunday, April 01, 2012 6:01 PM
     
     

    If I need to create an empty node, which is often the case with SAP, I'd use a logical functoid, set it to a true value and attach it to the element I want to create. In the case of the new mapper, it seams to create an element with a "true" value. I would have expected <node/>, but I get <node>true</node>.

    //Mikael


    If this answers your question, please use the "Answer" button to say so... Mikael - http://blogical.se/blogs/mikael

All Replies

  • Monday, April 02, 2012 10:28 AM
     
     

    Hi Mikael,

    Can you please clarify on which logical functoid you used in Biztalk map? It would be helpful if you share the snapshot of the map.

    AFAIK in biztalk, if a logical functoid is directly connected to the output, it governs the creation of the output and not the value. In the current mapper, the logical functoids just give a boolean output, and do not manipulate the generation of the output node, which explains the behavior that you saw

    . If you want to create an empty node, drop an if-then-else functoid, give the expression as true and the output values as empty strings("").

  • Monday, April 02, 2012 1:07 PM
     
     

    I was using an Equal functoid, and ended up using a string concatinate with an empty string. This solved the problem, but as many BizTalk developers are using the Equal functoid today, I think it'd be a good approch to have the same behavior.

    Btw, an Equal funktoid gives <emptyNode/>, where as using empty string produces <emptyNode></emptyNode>. Might not seam as a big deal, but with large messages it could.

    //Mikael


    If this answers your question, please use the "Answer" button to say so... Mikael - http://blogical.se/blogs/mikael

  • Friday, April 06, 2012 1:09 PM
     
     

    This behavior changed with the refresh release. Empty string wont create am emty node anymore. I can stilll get around it using one space in the string concatinate. However that now come out as <emptyNode> </emptyNode> (with a space between)


    If this answers your question, please use the "Answer" button to say so... Mikael - http://blogical.se/blogs/mikael

  • Friday, April 06, 2012 1:40 PM
     
     
    Actually, space didn't work that well. When working with SAP, I need to create empty nodes to indicate what data I want back. Empty nodes with space won't work. I got around it using a Map Foreach Loop.

    If this answers your question, please use the "Answer" button to say so... Mikael - http://blogical.se/blogs/mikael

  • Tuesday, April 10, 2012 9:20 AM
     
     

    In the refresh release,there is a new feature "Settings" in the ribbon at the top of the mapper surface to help configure the runtime behaviour. Click on this. In the dialog box that opens, go to 'Null/Empty Data Handling' and choose 'Generate empty nodes' as the option for 'Target Node Generation'. This will generate empty nodes when you give an empty string in a string concatenate and connect it to an output node.

  • Tuesday, April 10, 2012 12:40 PM
     
     

    Hi Mikael,

    We have added some new features in the Mapper in this release where you'll be able to configure aspects like error-handling and empty-node-handling. One of the features that has been added is to avoid generating empty nodes (since these can cause problems in large messages as you mentioned), and the default behavior is to not generate empty nodes. As Archana has already mentioned in her post, you can go and change this setting to cause empty nodes to be generated.

    HTH,

    Kranthi.

  • Tuesday, April 10, 2012 12:54 PM
     
     

    Hi Mikael,

    I also wanted to explain about the behavior you mentioned at the beginning of the thread. In BizTalk Mapper, as you might already know, if you connect the output of a Logical functoid to a record in the target schema, our compiler interprets it as an attempt to conditionally control whether that node will be output or not. So it will generate XSLT of the following form:

    <xsl:if select="$conditionVariableName">

      <Record>

         <!-- Code that needs to be generated to populate 'Record', if any -->

      </Record>

    </xsl:if>

    We don't have this behavior currently in the Integration Services Mapper. When you use a Logical Expression operation in the Integration Services Mapper, the operation will produce a boolean value as an output (just as the BizTalk functoids would), but the connection from the Logical Expression operation to the target schema is not interpreted specially - it's interpreted just like any other link to the target schema - as an indication that a value must be populated in the target document. That's the reason why you end up getting 'true' in your output document.

    HTH,

    Kranthi.