Why would you want to execute a single rule?<br><br>The logic you&#39;d write to determine which rule to fire should itself be part of the rules: So, for example, if you want to validate facts of type &quot;Smurf&quot; then write a rule that matches on &quot;Smurf&quot;. When you insert a &quot;Smurf&quot; only the rules that match on this will become candidates for execution when you call fireAllRules. Perhaps use of a stateless session would simplify things so you need not worry about other facts in WM &quot;polluting&quot; the results you expect to see? <br>
<br>More and more questions are posted here asking how to make individual rules execute; IMO the solution is to change your thinking about how Rules Engines work.<br><br>If you give your use-case we might be able to advise a better approach.<br>
<br>With kind regards,<br><br>Mike<br><br><div class="gmail_quote">2011/3/31 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br><br><div class="gmail_quote"><div class="im">On 31 March 2011 07:58, Benson Fung <span dir="ltr">&lt;<a href="mailto:benson.redhat@gmail.com" target="_blank">benson.redhat@gmail.com</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;">

Hi,<br>
<br>
If there are 10 rules in the drools rulebase, and right now I would<br>
like to execute one of the particular rule.  Is there any approach/way<br>
to execute particular rule programmatically?</blockquote></div><div><br>No. The right hand side of a rule (code between &quot;then&quot; and &quot;end&quot;) is executed whenever there is a set of fact objects in Working Memory satisfying the condition. If you insert such a set of facts and call fireAllRules(), then it will happen.<br>

<br> </div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">  I don&#39;t think<br>
agenda-group or activation-group can do that, right?  Or is it<br>
possible to create an agenda programmatically ?<br></blockquote></div><div><br>No to both.<br><font color="#888888">-W<br> <br></font></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<br>
Thanks<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
</blockquote></div></div><br>
<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>
<br></blockquote></div><br>