Re: JESS: Problem with definstance

2005-10-07 Thread David Firmin

Thanks again.

I've identified the problem. I had bean properties for all slots, but some
of the slot names started with capital letters which seemed to throw
definstance (I should have thought of this earlier).

I've resolved this by renaming the slots so that they're more in line with
the bean specs.

Thanks for all your help
Regards
David



   
 ejfried   
 Sent by:  
 owner-jess-users@  To 
 sandia.govjess-users@sandia.gov   
cc 
   
 05/10/2005 20:03  Subject 
   Re: JESS: Problem with definstance  
   
 Please respond to 
 [EMAIL PROTECTED] 
   .gov
   
   




I think David Firmin wrote:

 Hi,
 Thanks for this, although I'm still missing something I think.

 The Order class I'm trying to define as an instance does have accessors
and
 modifiers for all its properties, including the two defined on the
 superclass deftemplate that's already been created in the Rete.

To clarify, yes or no: does the template define any slots that
*don't* correspond to properties in the Order class?


-
Ernest Friedman-Hill
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]



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]




Re: JESS: Problem with definstance

2005-10-05 Thread ejfried
I think David Firmin wrote:

 I'm trying to create shadow facts that subclass a deftemplate that's
 already been added to the Rete. When I try and add the java bean using
 definstance I get a ClassCastException as follows:
 
 java.lang.ClassCastException
   at jess.DefinstanceList.createNewShadowFact(DefinstanceList.java:206)
   at jess.DefinstanceList.definstance(DefinstanceList.java:275)

Jess is assuming that the given class looks like a subclass of the
deftemplate -- i.e., if the template has slots foo and bar, then the
class had better have getFoo() and getBar() methods. It can have
additional properties as well, of course, as befits a subclass.

In any case, this is a lousy error message -- Jess should explicitly
detect and report this problem.


-
Ernest Friedman-Hill  
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]