[rules-users] activationCancelled() not being executed?

Fermion henss at physik.uni-wuppertal.de
Mon Oct 15 08:34:28 EDT 2007


I did some major code-cleaning in the meantime and I feel a bit more
comfortable now...

Unfortunately this still didn't help me with my two problems:
a) I still have the problem that my activations don't get canceled.
b) I don't think that I'll be able to distill the code in order to get a
self-contained project out of it.

So instead I had a closer look at the "Manners" example and I found only two
obvious differences from my code:

1. Manners uses a "StatefulSession" object, whereas I used a "WorkingMemory"
instance. I changed my code to use a StatefulSession as well, but the
strange behavior didn't disappear.

2. Manners uses the standard ClassLoader while I'm using an URLClassLoader
in order to access my rule files (I plan to deploy my application as a
single executable .jar file (created with "Fat Jar" eclipse plugin), but I
want to have my rule files in a separate folder). 
Changing this didn't help either.

So this basically means, that there is another difference that I've missed
so far.


What I HAVE seen is, that the fact IDs of my rules change (I think this is a
good thing):
If I insert a fact with a temperature value of (e.g.) "-15 °C", a
temperature-out-of-range rule gets activates (not fired).
In my little table an activation is added caused by the fact with the fact
ID 21:34.
Now I change the temperature of this fact back to something "in range"
(e.g.) "20°C". Instead of the activation being canceled and therefore
disappearing from my table, it just stays there.
Now I change the temperature back to something that is out of range: "-30
°C". A NEW activation is inserted into my table with a fact ID of 21:38. At
the same time, the fact ID of the first (still persistent) activation
changes to 21:38 as well!

I hope that this means that drools realizes that the fact value of the first
value has changed. But if this is true, then drools also noticed that the
value changed before, without cancelling the activation.
To my knowledge this also proves that my implementation of the fact beans
hashCode() and equals() methods is working correctly.

There has to be an error in my reasoning.

Thanks again,

fermion
-- 
View this message in context: http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a13211834
Sent from the drools - user mailing list archive at Nabble.com.





More information about the rules-users mailing list