<div dir="ltr"><br>&nbsp;&nbsp; Hans, <br><br>&nbsp;&nbsp; Your reasoning is correct. There should not be 2 instances of ApplicantStatus in the working memory. <br><br>&nbsp;&nbsp; Can you provide a test case showing the problem? we have test cases here using &quot;not&quot; and logical assertions, and it works properly.<br>
<br>&nbsp;&nbsp; Thanks,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2008/7/31  <span dir="ltr">&lt;<a href="mailto:ringsah@comcast.net">ringsah@comcast.net</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;">
<div>
<div><font size="2">
<p>How is &quot;</p></font><font size="2" face="Courier New">not</font><font size="2">&quot; supposed to work with </font><font size="2" face="Courier New">insertLogical</font><font size="2">? Assume I have two different rules whose conditions are mutually exclusive, like the following:</font><b><font color="#960000" size="2" face="Courier New">
<p>rule</p></font></b><font size="2" face="Courier New"> </font><font color="#008000" size="2" face="Courier New">&quot;</font><font color="#008000" size="2" face="Courier New">Rule One</font><font color="#008000" size="2" face="Courier New">&quot;</font><font size="2" face="Courier New">
<p></p></font><b><font color="#960000" size="2" face="Courier New">when</font></b><font size="2" face="Courier New">
<p></p></font><font size="2" face="Courier New">not NegativeResult()</font><font size="2" face="Courier New">
<p></p></font><b><font color="#960000" size="2" face="Courier New">then</font></b><font size="2" face="Courier New"> 
<p></p></font><b><font color="#960000" size="2" face="Courier New">insertLogical</font></b><font size="2" face="Courier New">(</font><font size="2" face="Courier New">new ApplicantStatus(&quot;Approved&quot;)</font><font size="2" face="Courier New">);</font><b><font color="#960000" size="2" face="Courier New">
<p>end</p></font></b><font size="2" face="Courier New"></font><b><font color="#960000" size="2" face="Courier New">
<p>rule</p></font></b><font size="2" face="Courier New"> </font><font color="#008000" size="2" face="Courier New">&quot;</font><font color="#008000" size="2" face="Courier New">Rule Two</font><font color="#008000" size="2" face="Courier New">&quot;</font><font size="2" face="Courier New">
<p></p></font><b><font color="#960000" size="2" face="Courier New">when</font></b><font size="2" face="Courier New">
<p></p></font><font size="2" face="Courier New">NegativeResult()</font><font size="2" face="Courier New">
<p></p></font><b><font color="#960000" size="2" face="Courier New">then</font></b><font size="2" face="Courier New"> 
<p></p></font><b><font color="#960000" size="2" face="Courier New">insertLogical</font></b><font size="2" face="Courier New">(</font><font size="2" face="Courier New">new ApplicantStatus(&quot;Denied&quot;)</font><font size="2" face="Courier New">);</font><b><font color="#960000" size="2" face="Courier New">
<p>end</p></font></b><font size="2" face="Courier New"></font><font size="2">
<p>Assume that the above two rules are the only way an </p></font><font size="2" face="Courier New">ApplicantStatus</font><font size="2"> fact can be inserted into working memory. I would expect, after all rules are run, that it would be impossible for there to be one </font><font size="2" face="Courier New">ApplicantStatus</font><font size="2"> with </font><font size="2" face="Courier New">&quot;Approved&quot;</font><font size="2"> as its reason, and another with </font><font size="2" face="Courier New">&quot;Denied&quot;</font><font size="2"> as its reason, in the working memory.
<p>I would expect that, before any </p></font><font size="2" face="Courier New">NegativeResult</font><font size="2"> is inserted, that rule one could run, and insert an </font><font size="2" face="Courier New">ApplicantStatus</font><font size="2"> fact with an </font><font size="2" face="Courier New">&quot;Approved&quot;</font><font size="2"> reason. Then, after a </font><font size="2" face="Courier New">NegativeResult</font><font size="2"> is inserted, that rule two could run, and insert an </font><font size="2" face="Courier New">ApplicantStatus</font><font size="2"> fact with a </font><font size="2" face="Courier New">&quot;Denied&quot;</font><font size="2"> reason. At this point I would expect that the original </font><font size="2" face="Courier New">ApplicantStatus</font><font size="2"> fact, with an </font><font size="2" face="Courier New">&quot;Approved&quot;</font><font size="2"> reason, would be retracted, since the conditions under which it was inserted are no longer true.
<p>This is not what I am observing, however. I am finding </p></font><font size="2" face="Courier New">ApplicantStatus</font><font size="2"> facts with both reasons in working memory at the end of the rules run. Should &quot;not&quot; work as I expect with regard to inserting a fact via </font><font size="2" face="Courier New">insertLogical()</font><font size="2">? Or is this a known limitation, or simply the way it is designed to work?
<p>Thanks,</p>
<p>-Hans</p></font></div></div>
<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><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>
</div>