Something to Drools over!

My good friend and Java froth-mouth, George Papas, shot me a link to a new Java framework yesterday called Drools. Drools, and it’s .NET red-headed cousin, Drools.Net, are a rules engine built upon the Rete algorithm developed by Dr. Charles L. Forgy.

I must say, I got pretty excited, as previous projects such as JRules and our very own BizTalk Business Rules Engine (Word doco) have been quite successful in implementing the Docs algorithm, so I was interested in having a squiz at what Drools could offer.

So what exactly is a Business Rules Engine? Well, to put it simply (from my PoV):

A place where you can decouple the semantics of a rule from its parameters. For example, I may have a dealer system that says, each time a customer buys x quantity of y, they get a z discount. Generally the structure of the rule will rarely change, but the values for x, y, and z may. So rather than embedding the rule and its variants in code, you embed the rule, and then load the variants from a policy file based on the current version of the rule. Your code then passes the values to a Business Rules Engine (BRE), and this will tell you whether the rules passed or failed. If it passed, you then choose to execute an action.

It’s pretty cool stuff if you’re creating systems that need to react to certain rules; especially when you consider that many business decision based systems are also moving heavily towards domain specific modelling. With the ability to create vocabularies, language and semantics within rules engines, true separation can be achieved between developers and business process architects.

Also, if you’re thinking about how this correlates with the release of Windows Workflow Foundation, it’s very similar, except the model for rules when they are applied to business logic versus humans is handled slightly differently. But the same pattern essentially holds true; if this evaluates true, do something about it ;)

So check out Drools[.NET], and let me know what you’se thinks!