In your scenario, I believe the best (better) approach would be to use a control fact (first in your RHS). Your context can become a Fact itself:-<br><br><span style="font-family: courier new,monospace;">rule &quot;one&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">when</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    Foo( value == &quot;bar&quot; )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    ...other patterns</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    ...do your thang</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;">
    <br><span style="font-family: courier new,monospace;">rule &quot;two&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">when</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    Foo( value == &quot;bar&quot; )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">    ...other patterns</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    ...do your other thang</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;">
<br><div class="gmail_quote">On 19 July 2011 16:25, magendo <span dir="ltr">&lt;<a href="mailto:robert.heisenberg@yahoo.com">robert.heisenberg@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
magendo wrote:<br>
&gt;<br>
&gt; 1. Using a contextObject which has foo and is checked in the first rule of<br>
&gt; each rulepackage. This first rule and the remaining rules in the<br>
&gt; rulepackage have the same agenda group. So if the first rule doesnt fit,<br>
&gt; the other rules wont be executed, either (does this really work? ;)).<br>
&gt;<br>
<br>
</div>Well, that doesnt even seem to work. Here are 2 examples I tried out:<br>
<br>
rule &quot;one&quot;<br>
auto-focus<br>
agenda-group &quot;foobar&quot;<br>
when<br>
 foo != bar<br>
then<br>
 drools.getWorkingMemory().clearAgendaGroup(&quot;foobar&quot;);<br>
end<br>
<br>
rule &quot;all the other rules&quot;<br>
agend-group &quot;foobar&quot;<br>
when some conditions<br>
then some consequences<br>
end<br>
<br>
This way the &quot;some conditions&quot; part is still executed in the lhs of &quot;all the<br>
other rules&quot;, altough I cleared the agendagroup &quot;foobar&quot; (I guess that<br>
happens because the rhs is only executed after fireallrules()).<br>
<br>
There must be a way to affect the lhs of the other rules before<br>
fireallrules() is executed?!<br>
<br>
Btw. my LHS is quite expensive thats why I dont wont to execute it 100 times<br>
when only the right one is needed.<br>
<font color="#888888"><br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Drools4-Filter-executed-rules-by-drl-file-tp3182568p3182842.html" target="_blank">http://drools.46999.n3.nabble.com/Drools4-Filter-executed-rules-by-drl-file-tp3182568p3182842.html</a><br>

</font><div><div></div><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>