Not refiring rules on retract or modify

12 views
Skip to first unread message

Jake Dempsey

unread,
Oct 27, 2009, 11:17:30 AM10/27/09
to Ruleby
Is it possible to only run a rule once for a given fact? It looks
like when any fact is retracted or modified, that all the rules are re-
run on all the facts. I can see that it would be very useful that a
rule only fire once for a given fact until that fact is modified.

Jake Dempsey

unread,
Oct 27, 2009, 12:17:17 PM10/27/09
to Ruleby
Drools has an option "noloop". I won't pretend to have a deep
understanding, but it seems that it prevents a rule from firing more
than once. How do I achieve this in ruleby?

Richard Pruss

unread,
Oct 27, 2009, 7:14:30 PM10/27/09
to rul...@googlegroups.com
So the thing I discovered is that the rerun thing is very order
depended.
So if you play with the order of the rules you can sometimes get a rule
to run only once even when some facts are being modified. With the
rule set I was playing with if I modified One Var it did not spin but
if I
modified Two var's it kept firing. The frustrating part was that
after the
modifications the rules should not have had the rule fire at all. So
I had
a rule that modified it's variables such that the action should not be
taken
a second time and it still kept firing...

Joe Kutner

unread,
Oct 27, 2009, 9:24:20 PM10/27/09
to rul...@googlegroups.com
There is definitely some work that needs to be done here.

The way in which Ruleby selects the activations to fire is designed so
that the Miss Manners benchmark will execute. That strategy is not
necessarily ideal for everyday applications.

I will investigate adding a "noloop" feature like Drools has. I think
this could be a valuable tool.

Richard, can you provide me with some examples of the behavior you
described. I'd like to work on those cases.

Thanks,

Joe
Reply all
Reply to author
Forward
0 new messages