[rules-users] make the rule not to fire when insert or update a fact

Wolfgang Laun wolfgang.laun at gmail.com
Fri Jun 7 01:14:23 EDT 2013


(1) Consider using fireAllRules() after each insert of a new Fact()
instead of fireUntilHalt(). This would permit you to smuggle in the
update of Now, between inserts of new Facts, whenever it needs to be
done.

(2) Consider retracting Fact (while keeping the data in a fact of some
other class).

(3) Consider adding a boolean to Fact's attributes: firedWithRuleX and
add this as a constraint.

(4) Consider inserting an auxiliary fact reflecting that some Fact has
fired with rule X.

-W


On 07/06/2013, suntrian <suntrian at 126.com> wrote:
> i write a rule like this
>
> rule
>      when
>             Now( now     )
>             Fact( attrib     )
>      then
>             //do something
> end
>
> Using a Thread with fireUntilHalt( ) Method.
> and then i update the Now regularly, and after that i insert a new Fact.
> the problem is that , when i update the Now( ) , the rule fired , and i
> insert the Fact, the rule fired again !
> How can i make the update operation do not trigger the rule , while just
> fire the rule when i insert the Fact ?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/make-the-rule-not-to-fire-when-insert-or-update-a-fact-tp4024186.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list