The nice folks on the Drools blog pointed me to an article today called Implement business logic with the Drools rules engine. This article was written by Ricardo Olivieri of IBM. Richard does a nice job of walking through both the basic case for using a business rules engine (BRE). I feel compelled to make a couple of points, though, before recommending it to you:
- Richard’s example only discuss decisions and the management of decisions implicitly.
His example revolves around a decision, as most good rules examples do, but I would have called out the focus on the “which tests does this machine require” decision. Note that it is a decision for a specific machine that is being automated and this transactional focus is typical. - While it shows the power of declarative programming it does not show the user engagement
One of the many reasons for using business rules is the power of the approach to bring business analysts and business users more directly into the process. While the Drools syntax is nice and declarative, it is a little user-hostile still. I am not sure the text engineers would feel comfortable editing the rules themselves. In general users need some “protection” from this level of detail to get engaged and this typically means templates and custom UIs as discussed here in our wiki. - The importance of decision management did not come through
While Richard talked about change and agility, he did not put much focus in the article on the ongoing management of the decision and the rules that support it. In most implementations this rapidly becomes the driving force for using business rules, not the initial replacement of code with something declarative.
All that said it is a nice worked example and worth a read for anyone with a basic Java background who wants to see how Drools works. It also has sample code for you to download. Enjoy.
Comments on this entry are closed.
I cannot find complete documentation of the syntax for those rule files!! Does one even exist?
Try http://www.jboss.org/drools/documentation.html!
Hi james, I’ve seen that documentation. It fails to go over really basic stuff like how data is made available to rule files from java classes. + the syntax isn’t explained *completely.
Thanks though, I’ll take a closer look at the examples.
Here’s a response from the Drools team:
Examples (we have more examples, and more indepth step by step than any other production rule engine):
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html/ch10.html
Rail road diagrams of the LHS:
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html/ch06s05.html#d0e3166
Working with the API:
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html/ch02s05.html#d0e900
Working with globals (not much to say here s it’s very basic):
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html/ch02s05.html#d0e948
Thanks again … didn’t mean to offend anyone.
I’m really starting to like the drools engine!