Playing around with Jess Event handling, I've just run into this one:
I defined a handler in Jess, using JessEventAdapter, to run a simple
deffunction whenever a new fact appears. Tested, works fine. Next, I
wrote a more general event handler, in Java, to fire whenever something
"interesting" occurs. OK, works fine, too, but only if you don't run them
both at the same time, and while becoming too interested in calls of
userfunctions. I think you can guess what happens.

The root of the problem appears to be the separation of event listeners
from the event mask. If the definition of the former were to be coupled
with some setting of the latter, so that the Rete could notify a
handler according to this handler's very own mask, all would be well
(as long as you don't set up a Jess handler for userfunction events!)
A proxy taking care of that could be written easily enough, but I
think it should be implemented in jess.Rete.

Regards
Wolfgang

Reply via email to