hi

I am trying to embed jess is java and having couple of issues.
I have got a rules file called rules.clp.  The outline
of which is given below.

(bind ?p (new java.util.Vector))

(defrule Rule1
LHS
=>
(call ?p addElement "value1")

(defrule Rule2
LHS
=>
(call ?p addElement "value2")

I am using java to run this rule file.  THe code I am using is given below.

public class Test
{

   public static void main(String [] argv) throws JessException
   {
    //Create Engine, load the rules to the jess engine
        Rete r = new Rete();
        FileReader rulesFile;
        Jesp jessParse;
        try {
           rulesFile = new FileReader("Rules.clp");
        }
        catch (FileNotFoundException fnfe) {
           rulesFile = null;
           System.out.println("Cannot open Rules.clp");
        }

        if (rulesFile != null) { //parse jess file
           jessParse = new Jesp(rulesFile, r);
        }
        r.executeCommand("(run)");
        Vector v = r.fetch("p");
   }
}

What I want to happen is get the Vector object that is declared in jess 
through java once the rules file is run.
I tried to get the vector by using the fetch method. The program compiles 
alright. But I am getting an error while running the application. Would 
appreciate any help.

Thanks

Sobha
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.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]
---------------------------------------------------------------------

Reply via email to