Re: JESS: Global Variables

2008-02-28 Thread Wolfgang Laun
It's difficult to guess what you tried. Is it similar to this: (defglobal ?*count* = 0) (defrule test-glob (test ( ?*count* 10)) = (printout t exceeds 10 crlf) ) (defrule inc-glob (record) = (++ ?*count*) ) This doesn't work since the test of ?*count* is evaluated only once. Only changes to

JESS: Global Variables

2008-02-27 Thread Nara Hari
Hi, We process a set of records through the rule engine and we would like to know the number of records processed and if it exceeds certain number we would like to do some special handling. We defined a global variable, and we incremented it in an ‘always true' rule. But the next rule where we

Re: JESS: Global Variables

2008-02-27 Thread Ernest Friedman-Hill
Pattern matching is driven by working memory (fact) changes. A rule that tries to match only a global variable will not be notified when that variable changes; the patterns will only be evaluated when facts matched by the rule change. If the rule matches no facts, then it's evaluated when

JESS: Global variables and bags

2004-05-27 Thread fb
Hi, I would need a little help. I try to create a bag and bind it to a global variable. This works well. After a reset (set-reset-globals is set to true) the global variable still point to the bag and the bag content still exists. Here the code: (defglobal ?*QueryList* = (bag create

Re: JESS: Global variables and bags

2004-05-27 Thread ejfried
I think [EMAIL PROTECTED] wrote: Any suggestions? bag create returns an existing bag if there's already one by that name; reset doesn't clear the list of bags. Therefore, although the defglobal is indeed reset, it's reset to set to the same object! Note that all bag does is manage a Hashtable

Re: JESS: Global variables and bags

2004-05-27 Thread fb
Great! Works Thanks Felix On 27 May 2004 at 15:16, [EMAIL PROTECTED] wrote: I think [EMAIL PROTECTED] wrote: Any suggestions? bag create returns an existing bag if there's already one by that name; reset doesn't clear the list of bags. Therefore, although the defglobal is indeed