When your command > (defclass dates RelevantDate) yields a deftemplate definition >(deftemplate dates extends __fact "$JAVA-OBJECT$ RelevantDate" > (slot class ...) > (slot OBJECT (type 2048))) then the RelevantDate class does most likely not conform to the JavaBean standard of naming getter/setter methods for the Bean's attributes. Thomas -- Sent through GMX FreeMail - http://www.gmx.net
Hello all,
I'm having trouble using the Jess command store() from Java to insert Java objects as facts into a Rete engine. The example in the user manual works, when calling Java's core packages i.e..
app.rete.store("BUTTON", new java.awt.Button("Press Me!"));
app.rete.executeCommand("(defclass button java.awt.Button)");
app.rete.executeCommand("(definstance button (fetch BUTTON) static)");
app.rete.executeCommand("(definstance button (fetch BUTTON) static)");
As expected, these commands create a deftemplate with the requisite slots for an instance of Button, and creats a fact with the slots filled. However, when storing a class defined in my program (here RelevantDate), only one slot seems to be created (
app.rete.store("DATE1", app.date1);
app.rete.executeCommand("(defclass dates RelevantDate)");
app.rete.executeCommand("(definstance dates (fetch DATE1) static)");
The resulting deftemplate:
(deftemplate dates extends __fact "$JAVA-OBJECT$ RelevantDate"
(slot class (default <External-Address:jess.SerializablePropertyDescriptor>))
(slot OBJECT (type 2048)))
(slot class (default <External-Address:jess.SerializablePropertyDescriptor>))
(slot OBJECT (type 2048)))
I have no trouble retrieving this object direct from the Java code, but I need a way to create individual slots for the variables in a RelevantDate object in Jess. Can anyone help?
Thanks in advance, Scott Duguid
Get Your Private, Free E-mail from MSN Hotmail 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] ---------------------------------------------------------------------
- JESS: Java reflection - the store () command Scott Duguid
- Re: JESS: Java reflection - the store () command ejfried
- Thomas Barnekow
