It’s a been a while I blogged. I literally did not have time even to check the blogosphere for past few months. My projects are going very very busy and having fun with Biztalk. In the midst of work, I learnt a few advanced properties in Biztalk mapping which can be set directly by editing the Biztalk map file. As usual use this at your own risk. These are not tested fully to use in Production/Live environments.
Optimizing Value Mapping Functoid Code Generation
If you have worked with Value mapping Functoids in Biztalk maps and had a chance to look at the generated XSLT, you can notice that there are a bunch of variables declared which may not be used if the xsl:if condition evaluates false. However due to this variable, there is some memory being wasted. Consider the code below
<xsl:variable name=”var:v1″ select=”ScriptNS0:MapSoemthing()” />
<xsl:if test=”string($var:v2)=’true'”>
<xsl:variable name=”var:v3″ select=”string($var:v1)” />
<ns0:text>
<xsl:value-of select=”$var:v4″ />
</ns0:text>
</xsl:if>
The variable v1 can be declared inside the <xsl:if> since it needs to be used only if variable v2 is true. You can resolve this problem by setting the “OptimizeValueMapping” attribute of the mapsource element in the map (.btm) file to “Yes” (Note:If the map is created from scratch in BTS 2006, then the default is “Yes”, if it was migrated from BTS 2004 or before, it is set to “No”)
Accommodating Schemas with Large Footprints
When the Mapper is using a schema that huge with a lot of loops, testing/ validating could take a long time or, in the worse case, some even result in an “out of memory” error. This could happen sometimes with complex schemas as well as with large schemas.
The problem with complex schemas is due to the fact that the Mapper has to recursively load the entire schema tree looking for nodes that either have links connected to them or have the Value property set on them.
You can resolve this problem by setting the “GenerateDefaultFixedNodes” attribute of the mapsource element in the map (.btm) file to “No”