[rules-users] Performance issue: why are rules outside of ruleflow-group evaluated?

Enda J Diggins ejdiggins at gmail.com
Tue Jan 11 06:06:43 EST 2011


Hey,

I had a similar issue where a massive log file was being generated due to
the activation and cancellation of rules outside of the current
ruleflow-group. My issues were not strictly performance related, I just
didn't want to sift through thousands of lines of logging. This is one way I
resolved my issue:

declare GroupOneFinished
end

rule "simple rule in group one"
ruleflow-group "group one"
 when
  DomainObject(expression == true)
 then
  //do something
end

rule "last rule to fire in group one"
ruleflow-group "group one"
salience -100
 when
  not GroupOneFinished()
 then
  insert(new GroupOneFinished());
end

rule "simple rule in group two"
ruleflow-group "group two"
when
 GroupOneFinished()
 DomainObject(costlyExpression == true)
then
 // do something
end

Clearly, this is not a pretty solution and, depending on how drools handles
the order of evaluation (does it stop trying to activate "simple rule in
group two" as soon as it realizes there is no GroupOneFinished object?), may
not add any performance gain, but it definitely reduced the size of my log
file!

Hope it helps,
Enda

On Mon, Jan 10, 2011 at 4:43 PM, H.C. <canterburry at gmail.com> wrote:

>
> Hey,
>
> We are dealing with performance issues at the moment are trying to find
> ways
> to improve the performance of our conditional statements.
>
> We see that when an update happens, drools will evaluate conditional
> statements of rules outside of the ruleflow-group currently active.
>
> Is there a way to prevent this from happening? It would substantially
> reduce
> the number of rules being evaluated and improve performance for us.
>
> Thanks for any help.
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Performance-issue-why-are-rules-outside-of-ruleflow-group-evaluated-tp2228232p2228232.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
>



-- 
Enda J Diggins
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110111/201f1b62/attachment.html 


More information about the rules-users mailing list