I think [EMAIL PROTECTED] wrote: > > Hi, > > I am facing a problem when attempting to use jess in my java Application > > I've defined the output and the input router but, once i lanch the code in > jess, i have the print in my TextAreawriter but when the code is asking > for an entry ,something like (assert (fact (read)), the system stalled... > it seems that the system immediatly read the content of my textreader (and > of course, i have no opportuity to enter my answer.... > > Have you any exemple on how launching a jess engine and how waiting for the > user reply ? >
This topic is treated in the book "Jess in Action", and of course if you've got a Jess license, you've got the source code, which includes the class jess.ConsolePanel which shows how to use TextReader and TextAreaWriter . But the number one problem people have with this kind of thing isn't really a Jess problem, but a problem of not understanding that in Java, all GUI events are handled in a single Thread, and if you block that Thread, no other events can be handled; so in particular, if you call jess.Rete.run() directly from an event handler, then the GUI will be frozen until Jess is through running. You need to create another Thread and run Jess from there. As I said, this isn't really a Jess thing -- it's just a Java programming thing. --------------------------------------------------------- Ernest Friedman-Hill Advanced Software 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] --------------------------------------------------------------------
