Your problem statement is somewhat vague, so I have to guess at the
details, but I let's say you've got a Bean class "Foo" with one
property "bar". Then

(defclass foo Foo)
(definstance foo (new Foo))

Let's say Foo looks like this:

public class Foo extends Thread
{
        private int bar;
        public Foo() { start(); }

        public int getBar() { return bar; }
        public void setBar(int i)
        { /* set property and issue property change event */}

        public void run() { int i=0; while (true) setBar(i); }
}

Then you have a rule like this:

(defrule report-foo-changes
        (foo (bar ?X))
        =>
        (printout t ?X crlf))

Now. The first time setBar() is called, the foo shadow fact is
modified. "report-foo-changes" is activated. While it is firing, it
calls "printout." Now, I/O is slow in any language, and there's
probably time for setBar to be called once or twice while
report-foo-changes is running. Therefore, before report-foo-changes
finishes, the foo fact has been modified several times. Each time it
is modified, the old activation of the rule is cleared, and a new one
is created. This is how you'd want things to behave: when
report-foo-changes runs, it reports the value of ?X at the last change
before the rule started to run. 

Anyway, that's probably what's happening. If you want each change to
be reported synchronously, then do it synchronously - for example, by
printing somethign in setBar(), or by registering your own
PropertyChangeListener. 
        

I think Vicken Kasparian wrote:
> 
> Hello:
> 
> I was doing some tests for a prototype I am working on and found the
> following situation.
> I have a rule that writes something to screen every time a data changes.
> When I create a burst of a high rate data change in a Java object, I am not
> getting a rule fire for each data change. That means some data change events
> are not triggering rules to fire. 
> 
> Is this an expected result or am I doing something wrong??
> 
> _________
> Vicken Kasparian
> Cheetah Technologies
> 941-739-3904 ext. 3550
> http://www.cheetahtech.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