simple
rule x:
if
a = 5
b = 3
c != 0
then
c = 0
keep in mind that using negation NOT means that condition does not exist. In other words, if I have this rule
rule y:
if
a = 5
b = 3
not c = 0
then
c = 0
rule y means a is 5, b is 3 and no c is zero. Say i assert 100
objects to the working memory and 1 of them has c = 0. it means rule y
would never fire, since there is a fact that satisfies "not c =
0".
hope that helps
peter
On 2/27/07, Premkumar Stephen <prem18@gmail.com> wrote:
Hi Dev team,
Its been fascinating to watch the growth of this tool. Here is my question:
Rule x:
if
a = 5
b = 3
then
c = 0
Now,
I have written this rule to run when a = 5 and b =3. But actually, I
would like it to ideally run when a = 5 and b = 3 and c != 0
Now, does the second scenario lead to any savings. In Ilog,
the second scenario will result in the rule NOT being added to the
agenda whereas it would in the first.
I cannot code the second
scenario into the rule as the rule ( as seen in UI) needs to match the
requirements version ( in Doors) and they do not want to add these to
the requirements. I would just like to make the second version for
performance. We have noticed that less number of rules would fire.
Now, if a = 5, b = 3 and c = 0, is there a way Drools can look
at it and say, let me not fire this rule since there is no practical
use anyways.
If not, what are the ways to automate not firing rules in scenarios where action does NOT cause updates to data.
Thanks!!
_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev