BizTalk 2013 Map Issue and Resolution (.NET XSLCompiledTransform omen)

Posted on

The other day I was doing migration of some of the application from BizTalk 2010 to BizTalk 2013 and after successful migration, there was an issue while testing few maps. The same map which worked perfectly as expected in 2010 were not so happy in 2013.

After looking through the same the issue was found. Went on though lot search and reads, found some interesting news.

There has been a drastic change in how maps are executed in BizTalk 2013. With the new version on BizTalk Microsoft has introduced .NET XSLCompiledTransform in place of .NET XSLTransform for the mspping engine.

With this in, there has been performance improvement and memory utilization improvements.

But this major change in the product has potential, to make your existing old version maps fail under certain circumstances.

The cases being :

1. If the map is using custom scripting functoid which has boolean parameter. Please refer HERE.

2. If the map has Extension Objects and Script Functions with certain implementation. Please refer HERE.

There is a great post here explaining the details. 

As explained in the KB article.:

For example, consider the following code within a scripting functoid:

public int AddIfTrue(int param1, int param2, bool addNum)
{
    if (addNum) return param1+param2;
    else return param1;
}

In BizTalk Server 2013, the behavior is as follows:

  • If addNum is true, false, or any other value the output is param1+param2
  • If addNum is empty the output is param1

In prior versions of BizTalk, the behavior was as follows:   

  • If addNum is false the output is param1
  • If addNum is true, the output is param1+param2
  • If addNum is empty or any other value the functoid fails with error “String was not recognized as a valid Boolean”

In order to revert to the previous behavior, the scripting functoid code can be modified to take a String parameter instead of Boolean and then convert the String to Boolean within the functoid code as follows:

public int AddIfTrue(int param1, int param2, string addNum)
{
    bool addNumBool = System.Convert.ToBoolean(addNum);
    if (addNumBool) return param1+param2;
    else return param1;
}

It is also possible to configured the BizTalk 2013 Transform Engine to use the older XSLTransform class. This approach is not recommended since the environment will lose the many performance and memory usage improvements provided by the XSLCompiledTransform class. This change can be made by adding DWORD UseXslTransform with value 1 at the following locations:   

  • For 64 bit BizTalk host instances: HKLM\SOFTWARE\Microsoft\BizTalk Server\3.0\Configuration
  • For 32 bit BizTalk host instances and Visual Studio’s Test Map functionality: HKLM\SOFTWARE\Wow6432Node\Microsoft\BizTalk Server\3.0\Configuration

So, we just need to keep an eye on this when we are doing migrations. 

 

 

Advertisements

3 thoughts on “BizTalk 2013 Map Issue and Resolution (.NET XSLCompiledTransform omen)

    John Muller said:
    January 12, 2015 at 1:55 pm

    I added the registry entry to use .NET XSLTransform but it isn’t working on a 32 bit windows 7 pc that I’m using to test BizTalk 2013.

      Ritu Raj responded:
      January 13, 2015 at 4:51 pm

      No sure why so. Technically it should. Did you try adding in other registry and also a system restart after registry entry ?

        John Muller said:
        January 13, 2015 at 6:48 pm

        I added in the registry entry for 64 bit OS and it’s working.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s