Microsoft’s Rule Engines

February 5, 2010

I am often asked to describe the rule engines that Microsoft ships. (The first question being: “Microsoft has rule engines?”) This question frequently comes from folks who know rules, but don’t know .NET. This post is specifically written to answer the question. Should the offerings change in the future, I will update this post as needed.

As always, this is not an official Microsoft statement. Questions about the future directions for these products should be directed to Microsoft.

As of this writing, Microsoft is currently shipping two rule engines. They are aimed at somewhat different audiences as described below.

MS BRE
The first rule engine is called the Microsoft Business Rule Engine (sometimes called “MS BRE” or “BRE”) and it has shipped as part of BizTalk Server since early 2004. BRE has shipped in BizTalk Server 2004, BizTalk Server 2006, BizTalk Server 2006 R2, BizTalk Server 2009 and I’m sure it will be included in the upcoming BizTalk Server 2009 R2.

WF Rules
The second rule engine is part of Windows Workflow Foundation in .NET, it is the Windows Workflow Foundation Rules Engine (sometimes called “Workflow Rules” or “WF Rules”). The WF rule engine originally shipped in late 2006 as part of .NET 3.0. It was also included in .NET 3.5 and .NET 4.0. If you are running Windows 7, Windows Server 2008 R2, Windows Server 2008, or Windows Vista or have installed .NET 3.0 or higher – you already have the WF rule engine on your computer. Update: I have an additional post specifically about rules in WF4.

Comparing MS BRE & WF Rules
Here are some comparisons of these engines written by other folks. Charles Young has written extensively on this topic.

A Short Summary Of Differences For Those Who Know Rules
If you asked me to summarize differences for a rules specialist, my comments would be along the following lines:

  • MS BRE is part of a BizTalk Server, which is a business-oriented server package, while WF Rules is part of the free .NET Framework which is more developer-oriented. (MS BRE may be used standalone outside of BizTalk, but is only licensed with BizTalk.) Both engines provide forward chaining execution. WF Rules also provides the option for sequential execution.
  • MS BRE rules are typically authored in the Rules Composer, while WF Rules are typically authored in Visual Studio. There are partners that provide a more BRMS-like authoring environment. MS BRE has features such as vocabularies and a respository, and is therefore closer to what Gartner defines as a BRMS.
  • MS BRE implements the Rete algorithm, while WF Rules does not. MS BRE uses eager evaluation, while WF Rules uses lazy evaluation. The performance profiles are accordingly different – WF “first hit” execution being faster, for example.
  • WF does not have assert/retract keywords or a Working Memory, while MS BRE does – so WF Rules requires all objects to be reachable from a common root object (this). (In WF Rules, support for multiple instances is achieved through forward chaining.) WF Rules supports “Else”, while MS BRE does not. MS BRE has some known restrictions around negation-as-failure. MS BRE has special handling for XML and DB fact types.

Related Technology
I would be remiss if I did not mention some Microsoft offerings that apply to related areas:

Lastly, I should also point out that the Mono Project is reimplementing Windows Workflow Foundation – including WF Rules.


On Chaining

January 7, 2010

One of the recurring topics in the rules world is forward chaining vs. backward chaining – how they compare, when to use one or the other, and which implementations even offer back chaining. I suspect that a lot of the confusion around backward chaining is simply due to the fact that most folks haven’t implemented production-quality systems that make use of it.

One of the forward vs. backward articles is by Dietrich Kappe. In his posting, he includes a quote from Charles Forgy, including the following:

Backward chaining systems are more limited than forward chaining systems.

Dietrich points out that the article was located on the old Rulespower site and disappeared with the purchase by Fair Isaac.

I’m posting here simply to point out that the Wayback Machine has them.

Charles Forgy on Forward and Backward Chaining

I have linked directly to the latest archived version of each article segment. You can find all the RulesPower content that they have here.

For further reading on the topic, the discussions at the following links are interesting (in no particular order):


Who Said It? “any backward chaining engine must eventually…”

January 7, 2010

I found a quote that James Owen used on the JESS mailing list and I’m interested in learning where it comes from. More specifically, is it in a paper or article somewhere and I’m just overlooking it? My suspicion is that James is quoting Dr. Charles Forgy and that it isn’t published in any articles.

I’ll email James to check the source – but I wanted to highlight the quote here since it was only used on the JESS list and could use a little more exposure.

“Any forward chaining engine can be made to do backward chaining and any backward chaining engine must eventually forward chain to deliver results.”

Updated on January 13, 2010:
James has confirmed (via email) that he was paraphrasing Dr. Charles Forgy here. The comment apparently was made during OPSJ training classes.


Rules Research Archaeology

January 7, 2010

Most readers should be familiar with George Santayana‘s quote about remembering the past (also called Santayana’s Law of Repetitive Consequences).

The rise of the BRMS over the last few years has brought lots of enthusiastic new members to our little rules world. These people are eager to contribute to the field and make their own mark. It is the job of the “old guard” to make sure the newcomers are properly aware of the prior research in our field. (Having only participated in the space since 1995, I consider myself to still be a newcomer.) For example, the rise of the multi-core processor means that tons of older research in parallel rule engines is of interest and relevant. For another example, the classic work on conflict resolution strategies doesn’t appear to be online and is in a long out-of-print 30-year-old book. (And at least the prices for “Pattern-Directed Inference Systems” are somewhat affordable – as of this writing, “Human Problem Solving” starts at $190 and goes up to $800 on Amazon.) A third example is that the Wikipedia article on the Rete algorithm only has references to papers that are not online for one reason or another. (I personally haven’t even seen the “A network match routine for production systems.” working paper.)

Thus, I would like to highlight a few useful resources:

We need to work together as a group to improve the online availability of our history.