BRE not calling .Net class

H,

I have a custom class to get a property that is used in an orchestration, however in our prod environment it's not getting called.   It looks like the BRE is getting called and when testing using the BRE composer it exceutes as expected.  The same set-up also works on our other enviroments.   Any ideas?  Many thanks in advance

[Serializable]

    public class BREHelper
    {
        private string SendLocationString;

        public string SendLocation
        {
            get
            {
                EventLog.WriteEntry("NBCU.BizTalk.PlanningGrid", "Get: " + SendLocationString, EventLogEntryType.Information);
                return SendLocationString;
            }
            set
            {
                SendLocationString = value;
                EventLog.WriteEntry("NBCU.BizTalk.PlanningGrid", "Set: " + SendLocationString, EventLogEntryType.Information);
            }
        }
    }



January 23rd, 2015 7:59pm

By far, the most likely reason is Static Support is not enabled on that computer.

https://msdn.microsoft.com/en-us/library/dd298814.aspx

About half way down, there is a registry entry to change.

  • Proposed as answer by Rachit Sikroria Saturday, January 24, 2015 3:52 PM
  • Unproposed as answer by GilesB1 Monday, January 26, 2015 11:13 AM
Free Windows Admin Tool Kit Click here and download it now
January 23rd, 2015 9:16pm

Hi,

 Enable invoking static methods without requiring an object instance by setting the value of the following registry key to 1 or 2:

HKLM\SOFTWARE\Microsoft\BusinessRules\3.0\StaticSupport (DWORD)

For value 2.

An object instance is not required. The static method is called at the policy translation time if all parameters are constant. This is a performance optimization because the static method is called only once, even though it is used in multiple rules in conditions. Static methods that are used as actions will not be executed at the translation time, but static methods used as parameters can be executed.

Thanks

Abhishek

January 24th, 2015 3:28pm

Thanks, I thought it could be that at first too however I don't have that setting on the 2 QA servers or my Dev boxes and it works as expected, it just seems to be when running it through the 2 prod servers.  FYI... I'm using BTS 2010.  Many thanks in advance!

Calling BRE:

Reg entries from:



Free Windows Admin Tool Kit Click here and download it now
January 26th, 2015 2:20pm

Had to post in 2 parts because of image limit :|  Thanks again!

Dev Reg:

Prod Reg:

January 26th, 2015 2:21pm

Hi GilesB,

Can you check BTSNTSvc.exe.config or BTNTsvc[64].exe.config file for static support entry in your QA and DEV boxes?

You will find a config entry like below:

<configuration>    
   <configSections>        
      <section name="Microsoft.RuleEngine" type="System.Configuration.SingleTagSectionHandler" />
   </configSections>    
   <Microsoft.RuleEngine 
   StaticSupport="1"    
   />
</configuration> 

The problem is that, by default, the BRE will not execute the static method, unless a specific registry setting is set.

Since you are using 64bit machine, then you can add StaticSupport registry key using either of the following options:

  • You need to look under HKLM\Software\Wow6432Node\Microsoft\BusinessRules\3.0. If this key exists, then you can add StaticSupport here.
  • Another option is to put StaticSupport in the BTNTsvc[64].exe.config file, also add this configuration in the configuration file of the Business Rule Composer (located in : C:\Program Files (x86)\Common Files\Microsoft BizTalk\Microsoft.RuleComposer.exe.config)

Hope this helps.

Rachit

Free Windows Admin Tool Kit Click here and download it now
January 26th, 2015 3:41pm

Thanks Rachit, however the class isn't static.  Thanks.
January 26th, 2015 4:15pm

Rachit Sikroria is correct, you can also set the StaticSupport option using the .config file.  The Registry setting is more common (at least that I've seen) and is what I would recommend.

To clarify the meaning of that setting, the class itself does not have to be static, only the member.  In C#, any static member is callable on a non-static class.

However, since it looks like you are passing an instance of BREHelper (it's cut off in the pic), there's something else going on.

Are you sure you have the exact same Assemblies deployed to each machine, versions included?

Free Windows Admin Tool Kit Click here and download it now
January 26th, 2015 4:30pm

Thanks Johns, that's interesting to know about any static member is callable on a non-static class.

I've checked the assemblies in the GAC's and used a reflector against them and they are the same ones that are working in QA and dev.

Thanks

January 26th, 2015 4:37pm

Hi,  FYI I also have 'StaticSupport' enabled in the BTNTsvc64.exe.config and Microsoft.RuleComposer.exe.config on both prod servers.  Thanks

<Microsoft.RuleEngine
 UpdateServiceHost="localhost"
 UpdateServicePort="3132"
 UpdateServiceName="RemoteUpdateService"
 CacheEntries="32"
 CacheTimeout="3600"
 PollingInterval="60"
 TranslationTimeout="3600"
 CachePruneInterval="60"
 DatabaseServer="UKROMDBWP008,4070"
 DatabaseName="BizTalkRuleEngineDb"
 SqlTimeout="-1"
 StaticSupport="1"
    />


Free Windows Admin Tool Kit Click here and download it now
January 26th, 2015 4:50pm

Then you need to enable Tracking on the Policy and see what the BRE is doing internally on the PROD machine(s).
January 26th, 2015 5:02pm

Hi,  FYI I also have 'StaticSupport' enabled in the BTNTsvc64.exe.config and Microsoft.RuleComposer.exe.config on both prod servers.  Thanks

<Microsoft.RuleEngine
 UpdateServiceHost="localhost"
 UpdateServicePort="3132"
 UpdateServiceName="RemoteUpdateService"
 CacheEntries="32"
 CacheTimeout="3600"
 PollingInterval="60"
 TranslationTimeout="3600"
 CachePruneInterval="60"
 DatabaseServer="UKROMDBWP008,4070"
 DatabaseName="BizTalkRuleEngineDb"
 SqlTimeout="-1"
 StaticSupport="1"
    />

Free Windows Admin Tool Kit Click here and download it now
January 26th, 2015 5:32pm

Few things I would try,

1-     1- Static Support- You have already checked this.

2-      2-Make sure policy/vocab are deployed and published in production env

3-      3- Make sure the class is GACed on all the BizTalk servers

4-      4-Are you using exception handling in BizTalk orch? It would help to catch any exception before or after call Rules

5-      5-If possible you can debug your Orch

6-      6-In your code of custom class, Following section is there

EventLog.WriteEntry("NBCU.BizTalk.PlanningGrid", "Get: " + SendLocationString, EventLogEntryType.Information);

Did you check if those event source has been created on production servers? NBCU.BizTalk.PlanningGrid

7-     7- Rule Engine Update service is running / restarted properly.

Ch

      Check event log entry for any warnings or errors on all your BizTalk servers (mainly where your orchestration processing host is running).

Th  there should be something.

C

January 26th, 2015 7:35pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics