On Jan 19, 2007, at 12:00 AM, Skeptic 2000 wrote:


Hi,

I have a rule looking something like :

(defrule wcooo ; exemple pour un while
(MyShadowfact (OBJECT ?o))
(test (< (str-length (?o methodreturningastring "param")) 3))
=>
(printout t "rulefired" (str-length (?o methodreturningastring "param")) crlf))

And I strangly get the rulefired message with values like 4, 5, 6, ...


Remember that pattern-matching is driven by facts being asserted, retracted, or modified. In particular, the test above will be evaluated only when the object is first put into working memory, or when a change event or modify call causes it to be reevaluated. My guess is that your method methodreturningastring returns a value which changes over time without Jess being notified in any way about the change. You will need to tell Jess when this value changes -- for example, by using the Rete.updateObject() method.

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.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