Hi Scott,
First, an aside: please don't sent HTML mail to mailing lists. As you
can see below, many folks will just get mostly gibberish.
To answer your question: the slots in a defclass correspond to Java
Beans properties, which are implemented as methods or method pairs
(i.e., getX() and/or setX() methods,) not member variables. Jess can
only pattern match on well-formed Bean properties. See section 2.7.4
of the Jess manual.
I think Scott Duguid wrote:
[text/html is unsupported, treating like TEXT/PLAIN]
> <html><DIV>
> <DIV>Hello all,</DIV>
> <DIV> </DIV>
> <DIV>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..</DIV>
> <DIV> </DIV>
> <DIV>app.rete.store("BUTTON", new java.awt.Button("Press Me!"));</DIV>
> <DIV>app.rete.executeCommand("(defclass button
>java.awt.Button)");<BR>app.rete.executeCommand("(definstance button (fetch BUTTON)
>static)");</DIV>
> <DIV> </DIV>
> <DIV> </DIV>
> <DIV>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.date1 is an instantiated instance of RelevantDate class</DIV>
> <DIV> </DIV>
> <DIV>app.rete.store("DATE1", app.date1);</DIV>
> <DIV>app.rete.executeCommand("(defclass dates RelevantDate)");</DIV>
> <DIV>app.rete.executeCommand("(definstance dates (fetch DATE1) static)");</DIV>
> <DIV> </DIV>
> <DIV>The resulting deftemplate:</DIV>
> <DIV> </DIV>
> <DIV>(deftemplate dates extends __fact "$JAVA-OBJECT$ RelevantDate" <BR> (slot
>class (default <External-Address:jess.SerializablePropertyDescriptor>))
><BR> (slot OBJECT (type 2048)))</DIV>
> <DIV> </DIV>
> <DIV>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?</DIV>
> <DIV> </DIV>
> <DIV>Thanks in advance, Scott Duguid<BR></DIV></DIV><br clear=all><hr>Get Your
>Private, Free E-mail from MSN Hotmail at <a
>href="http://www.hotmail.com">http://www.hotmail.com</a>.<br></p></html>
>
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------