I think Tsai Rodger wrote:
> HI Everyone:
>
> After Jess starts to run, is there anyway to assert new facts in Java, and
> fire the rules in Jess environment ?
>
> For example:
> =======================================
> Rete r;
> //... Loads and parses CLIPS files
> r.run();
> r.executeCommand("(assert (yes))");
> =======================================
> It seems like the fact "yes" will be asserted, BUT it cannot be used to
> fire any rule in Rete Object.
Well, sure, because you don't assert it until after the engine stops
running.
If I put (run-until-halt) in CLIPS code, then
> the program will block at "r.run()", and never go to assert facts. Does
> anyone have this problem, too ?
>
> Once Jess starts to run, how can I execute command after the run() ?
The same way that you would do two things at once in any Java program:
you need to explicitly do one of them in a separate
thread. run-until-halt (or the Java equivalent runUntilHalt()) never
returns, by definition; it's specifically designed to be run off in a
separate thread.
Of course, another alternative is simply to call run() again after
asserting the additional facts!
---------------------------------------------------------
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]
--------------------------------------------------------------------