The error message is telling you that the token '(' was found when a
valid slot value was expected -- i.e., Jess thinks the pattern is for
an ordered fact, not a deftemplate fact or a definstance. Although you
say the error happens when you "run the Rete engine," it doesn't; as
the stack trace clearly shows, it happens while the rule is being
parsed. What's going on is that the Rete engine connected to the
parser that is parsing rhe rule "trial1" hasn't yet seen the defclass
for "objectA2", so it's assuming "objectA2" is an ordered fact
template (the default assumption.)

If you're running this all from jess.Main, then you probably just need
to reorder your script so the defclass comes before the defrule. If
you're doing it from Java code, then either you need to rearrange your
Java calls, or you are (perhaps inadvertently) creating multiple Rete
objects, and the one that is seeing this rule is not the same one that
saw the defclass.


I think chinnaswamy gounder wrote:
> Hi All,
>         I am using definstance to assert facts to Rete
> object. For a bean "objectA2" having properties 
> "heigt","name" and "pulse" the templates and facts
> were created as under:
> 
> The template created was:
> 
> (deftemplate objectA2 extends __fact "$JAVA-OBJECT$
> objectA2" 
>  (slot class (default
> <External-Address:jess.SerializablePropertyDescriptor>))
> 
>  (slot height (default
> <External-Address:jess.SerializablePropertyDescriptor>))
> 
>  (slot name (default
> <External-Address:jess.SerializablePropertyDescriptor>))
> 
>  (slot pulse (default
> <External-Address:jess.SerializablePropertyDescriptor>))
> 
>  (slot OBJECT (type 2048)))
> 
> 
> The fact listed by the Rete object was:
> 
> f-0   (objectA2 (class
> <External-Address:java.lang.Class>) (height 120.0)
> (name "zz") (pulse 23) (OBJECT <External-Address:
> objectA2>))
> 
> I created the following rule with a pattern exactly
> matching the above fact.
> 
> ( defrule trial1
> (objectA2 (class ?cal) (height ?ht) (name ?nam) (pulse
> ?pul) (OBJECT ?ob2 ) ) 
> 
> =>
> (printout t " Value of Heitght" ?ht  crlf )
> (printout t " Value of Name   " ?nam crlf )
> (printout t " Value of Pulse  " ?pul crlf )
> )
> 
> While I run the Rete engine with the above rule, I met
> with the an error of Bad slot value:
> 
> Jess reported an error in routine Jesp.parsePattern.
>   Message: Bad slot value .
>   Program text: ( defrule trial1 ( objectA2 (  at line
> 2.
> 
> at jess.Jesp.parseError(Jesp.java:1556)
> at jess.Jesp.parsePattern(Jesp.java, Compiled Code)
> at jess.Jesp.parseLHS(Jesp.java, Compiled Code)
> at jess.Jesp.doParseDefrule(Jesp.java, Compiled Code)
> at jess.Jesp.parseDefrule(Jesp.java:848)
> at jess.Jesp.parseSexp(Jesp.java:158)
> at jess.Jesp.parse(Jesp.java, Compiled Code)
> 
> 
> I seek your help on this
> 
> Thanks and regards.
> 
> Chinnaswamy
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.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]
> ---------------------------------------------------------------------
> 



---------------------------------------------------------
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]
---------------------------------------------------------------------

Reply via email to