Re: [rules-users] Remove rule but timer still fires

2012-07-25 Thread Ladd
I just noticed a very similar observation in this JIRA entry:
https://issues.jboss.org/browse/JBRULES-3078

When I ran that test case with 5.4.0.Final it worked as it should (the timer
didn't continue to fire).  The difference is that the this test case is
calling:

kbase.removeRule( pkgName, ruleName );

where I'm calling:

org.drools.rule.Package pkg;

pkg.removeRule( rule );


Changing my code to call kbase.removeRule() got rid of the timer!!  Awesome!

- Ladd



--
View this message in context: 
http://drools.46999.n3.nabble.com/Remove-rule-but-timer-still-fires-tp4018509p4018902.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Remove rule but timer still fires

2012-07-06 Thread adeyinka . timi
I am out of office until Tuesday, 17th of July. If you have any urgent queries, 
you can contact Robert Doherty at robert.dohe...@nathean.com 01 6853001

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Remove rule but timer still fires

2012-07-06 Thread Wolfgang Laun
@developers: please comment

An existing/active rule with a timer produces an activation if the
conditions are met. This activation is now part of the Rete and
continues to be so until the LHS turns to false; the repeating timer
merely retriggers the execution of the consequence. Killing the rule
itself merely prohibits new activations.

Its debatable whether removing the rule should also retract pending
activations. This is not defined/documented for rules without timer
(at least I'm not aware of any such documentation), but surely all
kinds of rules should be treated alike.

-W


On 06/07/2012, Ladd  wrote:
> I see that working as an alternative to enable/disable.
>
> But what's the recommended approach for totally removing a rule that runs
> on
> a timer?  After running pkg.removeRule( rule ) the rule seems to be deleted
> because pkg.getRules() comes back empty.  Yet the rule with the timer
> continues to fire every 2 seconds.
>
> Thanks,
>
> - Ladd
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Remove-rule-but-timer-still-fires-tp4018509p4018513.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Remove rule but timer still fires

2012-07-06 Thread adeyinka . timi
I am out of office until Tuesday, 17th of July. If you have any urgent queries, 
you can contact Robert Doherty at robert.dohe...@nathean.com 01 6853001

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Remove rule but timer still fires

2012-07-06 Thread Ladd
I see that working as an alternative to enable/disable.

But what's the recommended approach for totally removing a rule that runs on
a timer?  After running pkg.removeRule( rule ) the rule seems to be deleted
because pkg.getRules() comes back empty.  Yet the rule with the timer
continues to fire every 2 seconds.

Thanks,

- Ladd

--
View this message in context: 
http://drools.46999.n3.nabble.com/Remove-rule-but-timer-still-fires-tp4018509p4018513.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Remove rule but timer still fires

2012-07-06 Thread adeyinka . timi
I am out of office until Tuesday, 17th of July. If you have any urgent queries, 
you can contact Robert Doherty at robert.dohe...@nathean.com 01 6853001

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Remove rule but timer still fires

2012-07-06 Thread Wolfgang Laun
On 06/07/2012, Ladd  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@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Remove rule but timer still fires

2012-07-06 Thread adeyinka . timi
I am out of office until Tuesday, 17th of July. If you have any urgent queries, 
you can contact Robert Doherty at robert.dohe...@nathean.com 01 6853001

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Remove rule but timer still fires

2012-07-06 Thread Ladd
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?

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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users