I found that the following doesn't work:

(defclass Thing com.xxx.Thing) ; the class Thing has a property called
"name" of type String
(definstance Thing (new com.xxx.Thing))
(defrule print-thing
   (Thing (name Zaphod))
=>
   (printout t "Thing named Zaphod found")
)

(bind ?theThing (new com.xxx.Thing))
(definstance Thing ?theThing) ; note - dynamic
(?theThing setName Zaphod)
(run)

but the rule will work if I define the rule like this:

(defrule print-thing
   (Thing (name "Zaphod"))
=>
   (printout t "Thing named Zaphod found")
)

I assume this has something to do with ATOMS vs. Strings but am not quite
sure why Jess doesn't match the former rule since it seems to do automatic
conversions as needed elsewhere (e.g. on the RHS.)

Please help me understand when the automatic conversion is done and when it
is not.

alan

Alan Moore - mailto:amoore@;ciphergen.com
Ciphergen Biosystems - http://www.ciphergen.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]
--------------------------------------------------------------------

Reply via email to