Since last year, I was conducting a bit of research about rule engines, specially in Java:
http://delicious.com/ajlopez/ruleengine
I reviewed JBoss Drools Expert (see http://delicious.com/ajlopez/drools). Past December, I assisted to Buenos Aires JBoss Meetup (see Spanish post)
In the old eighties, I met Rete Algorithm (see The Rete Matching Algorithm, Dr.Dobb’s). After all that, I decide to implement my own rule engine, in C#. You can check my progress at:
https://github.com/ajlopez/AjRools
This is the current solution:
As usual, it was coded using TDD.
I have facts, that are asserted, like Temperature = 38. And rules, that based on the asserted facts, produce other asserted facts (I plan to add actions, too, beyond fact assertions). A rule example:
# Rules example rules # Rule for Child Fever rule when Temperature > 38 Age <= 12 then HasFever is true end # Rule for Adult Fever rule when Temperature > 37 Age > 12 then HasFever is true end endI have ideas to extend the rule engine to support objects with properties, not only variables:
rule when p is_a Patient p.Temperature is 39 then p.HasFever is true endbut this feature is still in progress. I didn't adopt the Rete algorithm, yet, or something similar. I want to have a running implementation, with tests. Then, changing internal algorithm is like an exercise on refactoring.
Pending work: more object+properties support, session (client use of the internal implementation), etc.
Keep tuned!
Angel “Java” Lopez
http://www.ajlopez.com
Nice! Maybe this can eventually lead to a C# equivalent of drools, but with LINQ an other C# isms.
Thanks for starting this. Notice that there is a Drools Planner as well. This is equivalent to
Microsofts Solver Foundation CSP ( http://archive.msdn.microsoft.com/solverfoundation ). I keep hoping
that Microsoft would try to blend the rules engine that came with WF (but make it RETE) and the Solver.
Seems like the rules engine has gone no where for years.
Comment by Will Smith — February 25, 2012 @ 10:45 pm
[...] object support in AjRools Expert complete – Add method with parameters in AjLang complete – Post about my work on AjRools complete – New post about my work on AjLisp in Ruby pending – Post about my [...]
Pingback by New Month’s Resolutions: March 2012 « Angel “Java” Lopez on Blog — March 7, 2012 @ 7:09 pm
[...] en AjRools Expert Completo – Agregar soporte de métodos con parámetros en AjLang Completo – Post sobre mi trabajo en AjRools Completo – Nuevo post sobre mi trabajo en AjLisp in Ruby Pendiente – Post [...]
Pingback by Resoluciones del Nuevo Mes: Marzo 2012 - Angel "Java" Lopez — March 7, 2012 @ 10:06 pm