[rules-users] persistent java objects in working memory

Greg Barton greg_barton at yahoo.com
Wed Sep 23 23:12:59 EDT 2009


--- On Wed, 9/23/09, Chris Richmond <crichmond at referentia.com> wrote:

> So you are saying I should preferably do
> the update in the outer application loop rather than in the
> rule action even though I am using the lock-on-active statement 

Basically, yes.  The update statement should be used to indicate that an object has changed.  Using it for other purposes is of course possible, but I'd avoid it unless there was good reason.

See the attached sample project.  Is this what you're doing?  I put in a rule that checks the value of an object that is modified externally:

rule "Conditional Match"
  when
    c : Cycle()
    d : Data( value < 5 )
  then
    System.out.println( "Conditional Match: " + c + " with " + d ); 
end

Works fine.  


      
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DroolsCycle.tar.gz
Type: application/x-gzip
Size: 4697 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20090923/9a50767c/attachment.gz 


More information about the rules-users mailing list