I'm using Jess 5.1 and I have a javabean UserProfile that I am defclassing. If I
(ppdeftemplate) the result I get the following:
Reaper:RETE:(deftemplate UserProfile extends __fact "$JAVA-OBJECT$
com.hi.model.UserProfile"
(slot class (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot creationdate (default
<External-Address:jess.SerializablePropertyDescriptor>)
(slot curweight (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot dob (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot gender (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot height (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot id (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot implInfo (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot lastaccesstime (default
<External-Address:jess.SerializablePropertyDescriptor>)
(slot log (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot profileData (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot regweight (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot user (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot userInfo (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot valid (default <External-Address:jess.SerializablePropertyDescriptor>)
(slot OBJECT (type 2048))
which looks correct. I now definstance an instance of the bean and do a (facts)
where I get the following:
:f-3 (UserProfile (class <External-Address:java.lang.Class>)
(creationdate <External-Address:java.sql.Timestamp>)
(curweight <External-Address:jess.SerializablePropertyDescriptor>)
(dob <External-Address:jess.SerializablePropertyDescriptor>)
(gender <External-Address:jess.SerializablePropertyDescriptor>)
(height <External-Address:jess.SerializablePropertyDescriptor>)
(id <External-Address:jess.SerializablePropertyDescriptor>)
(implInfo <External-Address:jess.SerializablePropertyDescriptor>)
(lastaccesstime <External-Address:jess.SerializablePropertyDescriptor>)
(log <External-Address:jess.SerializablePropertyDescriptor>)
(profileData <External-Address:jess.SerializablePropertyDescriptor>)
(regweight <External-Address:jess.SerializablePropertyDescriptor>)
(use <External-Address:jess.SerializablePropertyDescriptor>)
(userInfo <External-Address:jess.SerializablePropertyDescriptor>)
(valid <External-Address:jess.SerializablePropertyDescriptor>)
(OBJECT <External-Address:com.hi.model.UserProfile>
The problem here is that ther than the slots OBJECT and creationdate the slots
don't seem to have values - rather they are still SerializablePropertyDescriptors.
For instance the slot height is coming from public double getHeight() and public
void setHeight(double height) so I would expect to be seeing (height 6.1) or some
such. Indeed when I use the fact in the LHS of a rule and attempt to (test..) the
value of slot height I explode (here ?ht is the variable used in the height slot in
the rules's LHS):
----
Jess reported an error in routine Value.numericValue while executing (< ?ht 4.5)
while executing (or (< ?ht 4.5)) while executing 'test' CE while executing rule LHS
(Node2) while executing rule LHS (TECT) while executing (definstance
GoalTargetWeightEvent ?obj dynamic) while executing defrule sanity-check-setup-1
while executing (run). Message: Not a number:
"<External-Address:jess.SerializablePropertyDescriptor>" (type = EXTERNAL_ADDRESS).
----
The odd thing about this is I have other defclass/definstance beans which are all
working just fine. The UserProfile JavaBean seems just fine.
Sign me "stumped in California"
Tnx
Alan Littleford
---------------------------------------------------------------------
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]
---------------------------------------------------------------------