<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Michal Bali wrote:
<blockquote
 cite="mid:58f4ed90905251518s6ff96017v89005b2dfa986da0@mail.gmail.com"
 type="cite">
  <div>Hi Kris,</div>
  <div><br>
  </div>
  <div>Thank you for quick response and explaining the details.</div>
  <div><br>
  </div>
  <div>I thought that the AgendaFilter would cancel the activations and
that the ruleflow would continue. Otherwise it doesn't make much sense
to use AgendaFilter with ruleflow. But if it is not supported I'll have
to live with that :)</div>
</blockquote>
It seems like a reasonable request, that if all the rules have been
cancelled, fired or filtered that the ruleflow-group should be
de-activated so the flow can continue. We'll look into it for 5.1.<br>
<br>
Mark<br>
<blockquote
 cite="mid:58f4ed90905251518s6ff96017v89005b2dfa986da0@mail.gmail.com"
 type="cite">
  <div><br>
  </div>
  <div>My use case: I have lot of rules. I need to be able to turn some
rules on and off depending on user input. I know that I could modify
rule conditions to check if a rule is enabled or not but this means lot
of duplicated conditions that are hard to maintain. I could also use
'rule inheritance' but it doesn't provide enough flexibility - it
supports only single inheritance.</div>
  <div><br>
  </div>
  <div>The problem is a crosscutting concern. It spreads across many
rules.&nbsp;An AgendaFilter seemed like the ideal candidate. <br>
Alternatively, as you've indicated, I could use an AgendaEventListener
and in the activationCreated method cancel the activation. However this
will require use of some Drools internal APIs...<br>
  <br>
Thanks for your help.<br>
  </div>
  <div><br>
  </div>
  <div>Best regards,</div>
  <div>Michal</div>
  <br>
  <br>
  <div class="gmail_quote">On Mon, May 25, 2009 at 4:45 PM, Kris
Verlaenen <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:Kris.Verlaenen@cs.kuleuven.be" target="_blank">Kris.Verlaenen@cs.kuleuven.be</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Michal,<br>
    <br>
A ruleset node only continues if the ruleflow group is it associated<br>
with is deactivated. &nbsp;A ruleflow group is deactivated automatically if<br>
it contains no more activations or if you deactivate it manually. &nbsp;By<br>
using an agenda filter, you are not executing the activation and thus<br>
the activation is never removed from the ruleflow group. &nbsp;Therefore, the<br>
process will keep waiting. &nbsp;This is expected behavior. &nbsp;Why were you<br>
expecting it to continue? &nbsp;I guess you would need some other kind of<br>
"filter" that not prevents the activation from firing but cancels<br>
activations that are not accepted by the filter?<br>
    <br>
Kris<br>
    <div>
    <div><br>
Quoting Michal Bali &lt;<a moz-do-not-send="true"
 href="mailto:michalbali@gmail.com" target="_blank">michalbali@gmail.com</a>&gt;:<br>
    <br>
&gt; Hi,<br>
&gt; If a rule is not allowed to fire by an AgendaFilter the whole<br>
&gt; ruleflow<br>
&gt; stops.<br>
&gt;<br>
&gt; I've created a small test case (attached). It contains:<br>
&gt; &nbsp;- one DRL file with one dummy rule that is in some ruleflow-group.<br>
&gt; &nbsp;- one RF file with three nodes ('start', 'ruleflow group' and<br>
&gt; 'end')<br>
&gt; &nbsp;- a program that starts the process, and calls fireAllRules with<br>
&gt; custom<br>
&gt; agenda filter.<br>
&gt;<br>
&gt; Once the program is executed the ruleflow will stop inside the<br>
&gt; ruleflow-group. If I remove the agenda filter it works as expected<br>
&gt; (the<br>
&gt; ruleflow finishes).<br>
&gt;<br>
&gt; Tested with Drools 5.0.1.<br>
&gt;<br>
&gt; Is this a bug or am I missing something?<br>
&gt;<br>
&gt; Best regards,<br>
&gt; Michal<br>
&gt;<br>
    <br>
    <br>
    <br>
    <br>
    </div>
    </div>
Disclaimer: <a moz-do-not-send="true"
 href="http://www.kuleuven.be/cwis/email_disclaimer.htm" target="_blank">http://www.kuleuven.be/cwis/email_disclaimer.htm</a><br>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>