Hello everybody
    I am using the following code in my java program.

            Rete r = new Rete();
            r.store("CustomObject", new Tmp.Employee(1, "Richard"));
            r.executeCommand("(defrule startup" +
                                " =>" +
                                "  (assert (name (call (fetch CustomObject) getName)))" +
                                "  (assert (no! (call (fetch CustomObject) getNo))))");

            r.executeCommand("(defrule match-input" +
                                "  (name ?a&:(eq \"Arjuna\" ?a))" +
                                "  (no ?b&:(< ?b 100))" +
                                " =>" +
                                "(store CustomObject2 (! new Tmp.Employee 1 \"Patten\")))");

            r.reset();
            r.run();
            Tmp.Employee app = (Tmp.Employee)r.fetch("CustomObject2"); 
            System.out.println("Class = " + r.fetch("CustomObject2").getClass());
            System.out.println("Finished Everything");

 

When I try and compile this I get the following error message.  What I am trying to do is to cast the value returned r.fetch("CusomObject2") into a Tmp.Employee.  And from there I want to use the methods available in this object.

TestApp.java [38:1] inconvertible types
found   : jess.Value
required: Tmp.Employee
            Tmp.Employee app = (Tmp.Employee)r.fetch("CustomObject2");

Could someone please tell me how to solve this problem.

thanks

Richard



Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com

Reply via email to