Indeed, registering a Userfunction to be called whenever a Userfunction is called would probably not work out too well!

I've always been leery of implementing event-specific notification because decisions to notify or not are made at time-critical moments; it's cheap to decide whether any handlers are registered at all, and skip everything, but it might not be so cheap to decide on a per- event basis whether something was listening or not. Still, you're probably right.


On Nov 7, 2007, at 1:44 PM, Wolfgang Laun wrote:

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





---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to