[rules-users] Remove rule but timer still fires

Wolfgang Laun wolfgang.laun at gmail.com
Fri Jul 6 14:52:32 EDT 2012


On 06/07/2012, Ladd <ladd at codemettle.com> wrote:
> I have a rule which runs every 2 seconds using
>
> *timer( int: 0ms 2s )*
>
> When I either disable
>
> *rule.setEnabled( new EnabledBoolean( false ) );*
>
> or remove the rule
>
> *pkg.removeRule( rule );*
>
> the timer continues to fire every 2 seconds.
>
> This is with version 5.4.
>
> I haven't been able to find the API for cancelling or stopping a timer.
> Can
> anyone point me in the right direction?


The usual technique is to have a Fact as part of the rule's LHS and
retract this, so the LHS doesn't match any more.
-W


>
> Thanks for the help!!
>
> - Ladd
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Remove-rule-but-timer-still-fires-tp4018509.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