Business rule may not be executed with no error or exception when conditions are met
The problem:
=============================
Sometime you may find business rules are not fired even if condition evalution is properly returned with True during Test Policy in Business Rule Composer.
Let's look at the following rule as an example.
When the condition is met, I found the actions were not fired. The itinerary name and version were not set as expected.
Cause:
=============================
Then what's the reason?
The root cause is actually on the OdbcConnection.ReleaseObjectPool call. This is a static method. However, please note Business Rule Engine (BRE) doesn't enabled calling class static members by default. For detailed information, please refer to:
Invoking Static Members of a Class
https://msdn.microsoft.com/en-us/library/aa950269.aspx
The solution:
=============================
So the rule will work properly if we set StaticSupport to 1 in regsitry or the config file as below:
NOTE: The registry path should be: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\BusinessRules\3.0 instead of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\BusinessRules\3.0 if BizTalk is installed on a 64bit OS.
Comment:
=============================
There does seem to be a problem here that the third action can impact the first 2 actions in this sample. At least, when a rule cannot be successfully executed, BRE should throw or raise some detailed exceptions/error messages instead of simply skipping the execution.
We plan on discussing this with BizTalk production group for more detailed follow up. Probably a design change request(DCR) will be filed to improve/correct the behavior.
Best regards,
WenJun Zhang