You are explicitly requesting that only one of Docs1 or Docs2 should be activated. This is the result of putting them into the same activation-group.<br><br>(From the code you&#39;ve posted, the no-loop attribute is useless as you don&#39;t do any updates in the consequences. And you are in a stateless session anyway.)<br>
<br>-W<br><br><div class="gmail_quote">2010/4/18  <span dir="ltr">&lt;<a href="mailto:Greg.Zoller@aviall.com">Greg.Zoller@aviall.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;">

<br><font size="2" face="sans-serif">Hello,</font>
<br>
<br><font size="2" face="sans-serif">Silly newbie question.  I&#39;m trying
to write my first rule set to handle permissions and I&#39;m running into a
problem where Drools is not executing the &#39;then&#39; clause of all my rules,
even though they all resolve to true.</font>
<br>
<br><font size="2" face="sans-serif">Here&#39;s my sample file:</font>
<br>
<br><font size="2" color="#a00000" face="Courier New"><b>rule</b></font><font size="2" face="Courier New">
</font><font size="2" color="#008000" face="Courier New">&quot;Docs1&quot;</font>
<br><font size="2" face="Courier New">        </font><font size="2" color="#a00000" face="Courier New"><b>activation-group</b></font><font size="2" face="Courier New">
</font><font size="2" color="#008000" face="Courier New">&quot;permissions&quot;</font>
<br><font size="2" face="Courier New">        </font><font size="2" color="#a00000" face="Courier New"><b>no-loop</b></font><font size="2" face="Courier New">
</font><font size="2" color="#a00000" face="Courier New"><b>true</b></font>
<br><font size="2" face="Courier New">        </font><font size="2" color="#a00000" face="Courier New"><b>when</b></font>
<br><font size="2" face="Courier New">         
      Resources( $resList : resourceList )</font>
<br><font size="2" face="Courier New">         
      $res : Resource(name==</font><font size="2" color="#008000" face="Courier New">&quot;CUSTOMER&quot;</font><font size="2" face="Courier New">,
allowed==</font><font size="2" color="#a00000" face="Courier New"><b>false</b></font><font size="2" face="Courier New">)
</font><font size="2" color="#a00000" face="Courier New"><b>from</b></font><font size="2" face="Courier New">
$resList</font>
<br><font size="2" face="Courier New">        </font><font size="2" color="#a00000" face="Courier New"><b>then</b></font>
<br><font size="2" face="Courier New">         
      System.out.println(</font><font size="2" color="#008000" face="Courier New">&quot;Foo&quot;</font><font size="2" face="Courier New">);</font>
<br><font size="2" color="#a00000" face="Courier New"><b>end</b></font>
<br>
<br><font size="2" color="#a00000" face="Courier New"><b>rule</b></font><font size="2" face="Courier New">
</font><font size="2" color="#008000" face="Courier New">&quot;Docs2&quot;</font>
<br><font size="2" face="Courier New">        </font><font size="2" color="#a00000" face="Courier New"><b>activation-group</b></font><font size="2" face="Courier New">
</font><font size="2" color="#008000" face="Courier New">&quot;permissions&quot;</font>
<br><font size="2" face="Courier New">        </font><font size="2" color="#a00000" face="Courier New"><b>no-loop</b></font><font size="2" face="Courier New">
</font><font size="2" color="#a00000" face="Courier New"><b>true</b></font>
<br><font size="2" face="Courier New">        </font><font size="2" color="#a00000" face="Courier New"><b>when</b></font>
<br><font size="2" face="Courier New">         
      Resources( $resList : resourceList )</font>
<br><font size="2" face="Courier New">         
      $res : Resource(name==</font><font size="2" color="#008000" face="Courier New">&quot;INVOICES&quot;</font><font size="2" face="Courier New">,
allowed==</font><font size="2" color="#a00000" face="Courier New"><b>false</b></font><font size="2" face="Courier New">)
</font><font size="2" color="#a00000" face="Courier New"><b>from</b></font><font size="2" face="Courier New">
$resList</font>
<br><font size="2" face="Courier New">        </font><font size="2" color="#a00000" face="Courier New"><b>then</b></font>
<br><font size="2" face="Courier New">         
      System.out.println(</font><font size="2" color="#008000" face="Courier New">&quot;Wow&quot;</font><font size="2" face="Courier New">);</font>
<br><font size="2" color="#a00000" face="Courier New"><b>end</b></font>
<br>
<br><font size="2" face="sans-serif">I&#39;m using a </font><font size="2" face="Courier New">StatelessKnowledgeSession</font><font size="2" face="sans-serif">
something like this:</font>
<br>
<br><font size="2" face="sans-serif">        ArrayList
ruleObjs = new ArrayList();</font>
<br><font size="2" face="sans-serif">        ruleObjs.add(resources);</font>
<br><font size="2" face="Courier New">        kbase.newStatelessKnowledgeSession().execute(ruleObjs);</font>
<br>
<br><font size="2" face="Courier New">So here&#39;s my problem.  Both of
the rules above resolve to true.  But only &quot;Wow&quot; is output
to the console.  If I comment out the Docs2 rule entirely then &quot;Foo&quot;
is output to the console (proving it also resolves true).</font>
<br>
<br><font size="2" face="Courier New">Why wouldn&#39;t I get &quot;Wow&quot;
and &quot;Foo&quot; output to the console (in no particular order) when
both are run?  </font>
<br>
<br><font size="2" face="Courier New">To see whether both rules are actually
being evaluated I also tried creating a simple message function that prints
something to the console and returning true. Then I eval() my function
as the last line of the when clause in Docs1.  &quot;Wow&quot; from
Docs2 is output as before, as is my function&#39;s message (proving that Docs1
was evaluated and resolved truthfully), but... Docs1 &#39;then&#39; clause is not
executed and Foo is not output.  Why?</font>
<br>
<br><font size="2" face="Courier New">This scenario holds true if I have
lots of rules.  Only the &#39;then&#39; clause of last one resolved true is
executed even though there may have been several other rules that resolved
true.</font>
<br>
<br><font size="2" face="Courier New">Thanks in advance for any ideas or
help!</font>
<br>
<br><font size="2" face="Courier New">Best regards,</font>
<br><font size="2" face="Courier New">Greg<br>
<br>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _<br>
<br>
This e-mail message, including attachments, may contain confidential, proprietary,
or export controlled information.<br>
Any unauthorized disclosure, distribution, or other use is prohibited,
unless expressly authorized. <br>
If you receive this e-mail in error, please notify the sender, and delete
all copies of the original message from your systems.</font><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>