All that runUntilHalt() does is sit in a loop. The loop calls run(),
and when run() returns, the loop calls Rete.waitForActivations() to
sleep until another rule is ready to run. Here's the whole routine (in
jess/Agenda.java):
int runUntilHalt(Rete r) throws JessException {
int count = 0;
do {
count += run(r);
if (m_halt)
break;
waitForActivations();
} while (!m_halt);
return count;
}
You can obviously write your own routine like this one, and add your
own code to be called each time run() terminates. Just put the routine
in your own Java class someplace. If you specifically want to loop
until halt is called (as opposed to some other condition) then you
could use defadvice to add code to (halt) so that you can find out
when that function is called, since otherwise you don't have access to
the m_halt member variable.
I think chinnaswamy gounder wrote:
> Hi All,
> There is no direct way to say whether a Rete
> object given a runUntilHalt() command is executing the
> rules or sleeping.
>
> Is it possible to specify a rule with a very
> low salience say -10000 so that it will be fired as
> the last rule and its action part will notify the
> completion of execution
>
> Anvance thanks for your advice on this.
>
> With best regards
>
> Chinnaswamy
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------