[rules-users] inserting collection of facts

Greg Barton greg_barton at yahoo.com
Sat Nov 8 20:04:16 EST 2008


That would break the contract of sequential mode, as I understand it.  Basically sequential mode assumes you're working with the same set of data, the same set of rules, and they apply in exactly the same way from start to finish.  Anything that alters execution based on prior execution is out. :)  This allows sequential mode to be very fast, but at the cost of functionality.  Ain't there always a cost?

That being said, what you're talking about sounds close to activation groups.  I'm not sure if activation groups works in sequential mode, but it's worth a try.

--- On Sat, 11/8/08, techy <techluver007 at gmail.com> wrote:

> From: techy <techluver007 at gmail.com>
> Subject: Re: [rules-users] inserting collection of facts
> To: rules-users at lists.jboss.org
> Date: Saturday, November 8, 2008, 5:48 PM
> I was under impression that in stateless session, If we
> modify the facts, it
> would not re-evaluate rule(got confused with Sequential
> mode :-)). But I
> tried stateless session as per your advice. It did work !
> Thanks a lot Greg!
> 
> In Sequential Mode, Now It does not re-evaluate any rule if
> any facts
> modified. I'm thinking of this new feature. If any
> facts modified, then
> re-evaluate only subsequent rules( i.e all rules with less
> salience than
> that of current rule's) and provide some flag to
> enable/disable this
> feature.
> this feature would be very useful If I we want to control
> execution of the
> rules with less salience by rules with higher salience in
> Sequential Mode.
> Actually I want to control rules execution this way. Is
> there any hack to
> achieve this now?
> 
> Thanks again!
> 
> 
> 
> Greg Barton wrote:
> > 
> > 
> > --- On Fri, 11/7/08, techy
> <techluver007 at gmail.com> wrote:
> > 
> >> Can you please advise which of two is best
> approach?
> >> 
> >> 1. Having multiple rulebase and assign to child
> thread.
> >> each child thread would a single stateful session
> and fire rule for 
> >> given facts.
> >> 2. having one rulebase and create multiple
> stateful session
> >> and assign to each child thread.
> > 
> > That would depend on the structure of the rules, and
> specifically on the
> > number of object join rules in your rule base.  The
> only way to know,
> > truthfully, is to try both ways with typical data
> sets.  
> > 
> >> 3. I would give batch of facts to child threads.
> once they
> >> complete the firing rules. now I want to release
> these facts from 
> >> memory before I process next batch of facts using
> same or new child 
> >> threads.  Do I need to do any explicit clean up in
> either rulebase or 
> >> stateful session ? or would JVM GC take care of
> the clean up as long 
> >> as I don't maintain any ref to those facts in
> my application?
> > 
> > You  must retract them from the working memory for the
> objects to be
> > GC'ed.  Otherwise the stateful session would
> maintain a reference to them. 
> > You could also just destroy the stateful session
> itself.  That might
> > actually be quicker. (Assuming that you're
> starting the stateful session
> > from starting conditions during each batch run.) 
> Although at that point
> > why have a stateful session? :)  It sounds to me like
> a stateless session
> > might be more what you need, really.  Have you tried
> it?
> > 
> > 
> > 
> >       
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> > 
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/inserting-collection-of-facts-tp20374245p20401807.html
> Sent from the drools - user mailing list archive at
> Nabble.com.
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


      



More information about the rules-users mailing list