Good day everyone,
I am a new jess user. I was trying to learn how to use Jess in Java
off the Jess webpage. In section 4.6 (the jess.Funcall class), there is
an example that teaches new users how to use the jess.Funcall class. I
copied the example, and it works, but when i tried to use my own class
(Event.java) instead of the button class in the java.awt.button, I got
some weird error. Thank you in advance. Here is my code...
package Test;
import jess.*;
import java.awt.Button;
public class Main
{
public Main()
{
try
{
Rete engine = new Rete();
engine.addUserpackage(new MiscFunctions());
engine.addUserpackage(new jess.ReflectFunctions());
Context con = engine.getGlobalContext();
//Value myButton = new Value("button", RU.ATOM);
Value aValue = new Value("event", RU.ATOM);
Funcall f = new Funcall("batch", engine);
f.add(new Value("jess/scriptlib.clp", RU.STRING));
f.execute(con);
/*
f = new Funcall("defclass", engine);
f.add(myButton).add(new Value("java.awt.Button", RU.ATOM));
f.execute(con); */
f = new Funcall("defclass", engine);
f.add(aValue).add(new Value("Event", RU.ATOM));
f.execute(con);
f = new Funcall("definstance", engine);
f.add(aValue);
f.add(new Value(new Event("one", "two")));
f.execute(con);
//new Funcall("definstance", engine).arg(myButton).arg(new
Value(new Button("Press Me!"))).execute(con);
f = new Funcall("facts", engine);
f.execute(con);
}
catch(JessException e)
{
System.out.println("error " + e);
}
}
public static void main(String[] arg)
{
new Main();
}
}
and the error....
Jess reported an error in routine definstance while executing
(definstance event
<External-Address: Test.Event>).
Message: Obj doesn't accept PropertyChangeListeners.
My event class is just a class with three string instance variable and a
constructor
tha takes in two string parameters.
Thank you for your patience
Leo
---------------------------------------------------------------------
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]
---------------------------------------------------------------------