Monday, February 28, 2005

Rules Engine III

Thanks to Jon Flanders at Developmentor for answering my Rule Engine query. The answer is to use the "update" action to reassert Fact2 once it has been updated, and to then add in a second predicate to the first rule to prevent the policy from entering a recursive loop.

Rule1: If Fact1 == Y and Fact2 != Y then Fact2 = Y; Update Fact2;
Rule2: If Fact2 == Y then Fact3 = Y;

There are a couple of issues that I have with this:

1. The need to include the Fact2 != Y predicate explicitly seems incorrect to me - I would have thought that the rules engine's evaluation and agenda building should have worked that out itself, and prevented the loop?

2. The above concern, together with the need to explicitly reassert Fact2 mean that rule creation has just crossed a critical boundary - and I challenge anyone to find me a business analyst who would feel comfortable with this scenario. All the vocabularies in the world will not make rule creation a BA-friendly activity if they are required to understand the internal workings of the rule engine.

1 comment:

Marco Ensing said...

Check out