The standard practice is to call Rete.runUntilHalt() in a dedicated
thread. The code below doesn't work because the event is sent just
before the activation is added to the agenda. If it -did- work, it
would be a bad idea because activations of course are often created
during a run, do you'd be calling run() recursively -- not a good
thing.
I think Eric Jain wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Is it possible to set Jess into a mode where every activation triggers a
> run? I have tried the following, but it doesn't work, i.e. rules are
> only fired when I call engine.run() subsequently.
>
> engine.addJessListener(new JessListener()
> {
> public void eventHappened(JessEvent event)
> throws JessException
> {
> switch (event.getType())
> {
> case JessEvent.ACTIVATION:
> engine.run(); // Doesn't do anything!
> break;
> ...
> }
> }
> });
>
> --
> Eric Jain
>
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
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]
--------------------------------------------------------------------