“This Article discusses using the Drools.NET project in a Visual Studio 2008 Forms application. It goes through the steps to use the project files, as well as a brief discussion of the Drools Rule Syntax.
There are lots of articles on the web explaining why applications should have the business logic separated from the application logic. During my time with Blaze Software, Neuron Data, and Inference Corporation, I must have given that presentation a thousand times. I am not going to go into all of that here.
Instead, I will attempt to show what can be done with a Business Rules System -- even if you don’t have the six figure budgets necessary to implement a solution using one of the commercial Rules Management systems, (such as Fair Isaac’s Blaze Advisor or Ilog’s JRules -- or whatever it will be called now they have been bought by IBM.)
JBOSS Rules and DROOLS.NET
An open source alternative to the commercial business rules engines is DROOLS -- re-branded now as JBOSS rules. It has recently given its internal algorithm a speed boost, and it has announced that it will support the legacy syntax used by Inference’s ART, and NASA’s CLIPS project. (as well as several other rules syntaxes.) Honestly, I was never overly fond of the ART syntax – which was too LISP-like for my tastes. However, there is no arguing that it was a very successful language, and there are a lot of examples and applications still available today for it. The main thing is that with DROOLS, you have several syntaxes to choose from, which is always a good thing.
This article is my somewhat expanded example which describes how rules are used in DROOLS.NET, and gives some explanation on how a rules system is implemented. It is not meant to be an in-depth tutorial, it is simply a starting point that I hope is useful.
I have the full application as part of the article so you can download and follow along – that way you don’t end up with typos like the unfortunate Drools.Net developer who did the online docs ;-) I should note that I am using the commercial version of Visual Studio 2008. I have not tested this in the free version, nor in 2005 – and, though I would expect it to run there, YMMV.
There’s something about rules engines that attract me… Yeah, I know, I know, I need a life… Still I dig the dream of having my source and rules separate, with the rules being human readable, easily formatted and written by domain experts (i.e. let the business write the business rules… imagine that! ;)
Related Past Post XRef:
Java Implementation for Mono/.Net
"Converting PDF to Text in C#" with PDFBox/IVKM.Net