<br><font size=2 face="sans-serif">Hello,</font>
<br>
<br><font size=2 face="sans-serif">Silly newbie question. &nbsp;I'm trying
to write my first rule set to handle permissions and I'm running into a
problem where Drools is not executing the 'then' clause of all my rules,
even though they all resolve to true.</font>
<br>
<br><font size=2 face="sans-serif">Here'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">&nbsp; &nbsp; &nbsp; &nbsp; </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">&nbsp; &nbsp; &nbsp; &nbsp; </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">&nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#a00000 face="Courier New"><b>when</b></font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; Resources( $resList : resourceList )</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; $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">&nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#a00000 face="Courier New"><b>then</b></font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; 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">&nbsp; &nbsp; &nbsp; &nbsp; </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">&nbsp; &nbsp; &nbsp; &nbsp; </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">&nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#a00000 face="Courier New"><b>when</b></font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; Resources( $resList : resourceList )</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; $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">&nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#a00000 face="Courier New"><b>then</b></font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; 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'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">&nbsp; &nbsp; &nbsp; &nbsp; ArrayList
ruleObjs = new ArrayList();</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; ruleObjs.add(resources);</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; kbase.newStatelessKnowledgeSession().execute(ruleObjs);</font>
<br>
<br><font size=2 face="Courier New">So here's my problem. &nbsp;Both of
the rules above resolve to true. &nbsp;But only &quot;Wow&quot; is output
to the console. &nbsp;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't I get &quot;Wow&quot;
and &quot;Foo&quot; output to the console (in no particular order) when
both are run? &nbsp;</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. &nbsp;&quot;Wow&quot; from
Docs2 is output as before, as is my function's message (proving that Docs1
was evaluated and resolved truthfully), but... Docs1 'then' clause is not
executed and Foo is not output. &nbsp;Why?</font>
<br>
<br><font size=2 face="Courier New">This scenario holds true if I have
lots of rules. &nbsp;Only the 'then' 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>