Jess experts:
 
How do I know if Jess has completed a scan of all the rules in its knowledge base?
I am trying to build a command-response framework, where the commands are (short-lived) beans that are instantiated prior to a Jess run(), and then are released after the results are obtained. I'm trying to figure out if there is some way I can tell if Jess is "done" (perhaps set a field in the bean itself).
 
Specifically, I want to know if the following design/pseudocode will work:
 
public class RuleEngine extends Thread
{
    private Rete rete;
    public RuleEngine()
    {
          rete = new Rete();
         rete.addUserpackage(new MiscFunctions());
          rete.addUserpackage(new jess.ReflectFunctions());
        // Read in the rules
          rete.executeCommand("(clear)");
          rete.executeCommand("(batch sample.clp)");
    }
    public void run()
    {
         // create bean instance
        Funcall f = new Funcall("definstance", rete);    
         f.add(new Value("Command", RU.ATOM));
         f.add(new Value(command));
        // code to "lock" the bean
         rete.executeCommand("(reset)");
         rete.executeCommand("(run)");
        // code to release this instance
        // code to "unlock" bean
        {
            sleep for some time
        }
   
    }
}

Reply via email to