<br>   In Drools 4 I would use ruleflow to design a flow of groups of rules. <br><br>   It sounds like you are implementing a decision tree?!<br><br>   []s<br>   Edson<br><br><br><br><div class="gmail_quote">2009/4/14 Charles Binford <span dir="ltr">&lt;<a href="mailto:Charles.Binford@sun.com">Charles.Binford@sun.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Edson,  Thanks for your reply.  Unfortunately I failed to say I need<br>
drools 4.0.7 because of its GA status.<br>
Any suggestions for an approach with drools 4?<br>
<br>
Charles Binford<br>
<div class="im"><br>
Edson Tirelli wrote:<br>
&gt;<br>
&gt;    If I understood correctly, all you need to do (in Drools 5) is to<br>
&gt; use rule inheritance. Also, in case your &quot;non-leaf&quot; rules have nothing<br>
&gt; to do in their consequences, you can mark them with attribute &quot;enabled<br>
&gt; false&quot;.<br>
&gt;<br>
&gt; <a href="https://svn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/extend_rule_test.drl" target="_blank">https://svn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/extend_rule_test.drl</a><br>

&gt;<br>
&gt;    So, have rule 1.2 extend rule 1. Have rule 1.2.1 extend rule 1.2<br>
&gt; and so on. Mark the ones that don&#39;t have consequence actions with<br>
&gt; enabled false just to avoiding creating useless activations. You still<br>
&gt; need to prioritize rules with salience or whatever you are using for that.<br>
&gt;<br>
&gt;    That should do the trick. Report back your findings please, as this<br>
&gt; is a new feature in Drools 5.<br>
&gt;<br>
&gt;    Hope it helps,<br>
&gt;       Edson<br>
&gt;<br>
&gt; 2009/4/13 Charles Binford &lt;<a href="mailto:Charles.Binford@sun.com">Charles.Binford@sun.com</a><br>
</div>&gt; &lt;mailto:<a href="mailto:Charles.Binford@sun.com">Charles.Binford@sun.com</a>&gt;&gt;<br>
<div><div></div><div class="h5">&gt;<br>
&gt;     All,  I&#39;m trying to figure out a better way to solve this problem.  I<br>
&gt;     have a batch of objects that I want matched against a hierarchy of<br>
&gt;     rules.  I check the rules in order, and as soon as I find a match I&#39;m<br>
&gt;     done for that level of the hierarchy.  In other words, If the object<br>
&gt;     matches a rule, we&#39;ll check the rules children, but not the siblings.<br>
&gt;     Example:<br>
&gt;<br>
&gt;     rule 1<br>
&gt;      rule 1.1<br>
&gt;      rule 1.2<br>
&gt;        rule 1.2.1<br>
&gt;        rule 1.2.2<br>
&gt;      rule 1.3<br>
&gt;     rule 2<br>
&gt;<br>
&gt;     If an object matches rule 1, check for a match at level &quot;1.*&quot;, but<br>
&gt;     rule<br>
&gt;     2 will never be checked.  If an object matches 1, 1.2, and 1.2.1,<br>
&gt;     we&#39;re<br>
&gt;     done as 1.2.1 has no children.<br>
&gt;<br>
&gt;     My current implementation with drools works, but is very<br>
&gt;     inefficient.  I<br>
&gt;     have a &quot;level&quot; string in the objects and whenever I find a match I<br>
&gt;     update the level of the object and force an object update.  Each rule<br>
&gt;     tests that the level string is correct, e.g. rule 1.2.1 works as<br>
&gt;     follows:<br>
&gt;     rule &quot;1.2.1&quot;<br>
&gt;     when<br>
&gt;        obj(level matches &quot;1.2.*&quot;,.....)<br>
&gt;        ...<br>
&gt;     then<br>
&gt;        objSetLevel(&quot;1.2.1.*&quot;);<br>
&gt;        ....<br>
&gt;     end<br>
&gt;<br>
&gt;     I&#39;m also using saliance to keep the evaluation order like I want it.<br>
&gt;<br>
&gt;     Changing the contents of the object and doing the update is not<br>
&gt;     good for<br>
&gt;     drools performance as I understand it so I&#39;m looking for a better way.<br>
&gt;     The hierarchy and the order of the matching is key to my<br>
&gt;     application so<br>
&gt;     I&#39;m not wanting to redesign that part of things.<br>
&gt;<br>
&gt;     I tried using activation-groups.  That worked great as long as I only<br>
&gt;     had a single object to run through the hierarchy, but given the<br>
&gt;     way the<br>
&gt;     rest of the system is design I need to load up 10-100 objects before<br>
&gt;     each call to fireallrules() for performance purposes.<br>
&gt;<br>
&gt;     Any suggestions are appreciated.<br>
&gt;<br>
&gt;     Charles Binford<br>
&gt;<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     rules-users mailing list<br>
</div></div>&gt;     <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a> &lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
<div class="im">&gt;     <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt;  Edson Tirelli<br>
&gt;  JBoss Drools Core Development<br>
</div>&gt;  JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a> &lt;<a href="http://www.jboss.com" target="_blank">http://www.jboss.com</a>&gt;<br>
&gt; ------------------------------------------------------------------------<br>
<div><div></div><div class="h5">&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>