Given how easy it is to call BRE rules from a Microsoft BizTalk RFID process, it's surprising how few people make use of this feature. And that gives me a topic to blog about!

So, here starts my first post...

BizTalk RFID provides support for executing BRE policies through two classes that are inside microsoft.rfid.oobcomponents.dll: RuleEnginePolicyExecutor and RfidRuleEngineContext.

RuleEnginePolicyExecutor, like SqlServerSink, is an out-of-the-box component that can be added to an RFID process. It is available in New Process->Bind wizard-> New Component. Adding the component opens a prompt asking for the BRE policy to be executed. XML facts and database facts to be asserted to this policy can also be specified here.

RuleEnginePolicyExecutor is responsible for executing the specified BRE policy. It puts together the XML and database facts specified while adding the component with .net objects passed by previous event handlers (RfidEventContext.Data) along with an instance of RfidRuleEngineContext to make a complete list of facts to be passed to the BRE policy.

RfidRuleEngineContext is passed as a fact to the BRE policy and contains several useful functions like GetTagID, GetTagData, UpdateVendorSpecificData, GetSource that can be used to make BRE rules. In the Business Rules Composer, this class can be used as a .NET fact by browsing the gac to select microsoft.rfid.oobcomponents.dll. From here on, we can drag and drop functions from this class to make rules in the cool Business Rules Composer way.