Yes, a single fact will match multiple patterns but you can avoid it (As far as I remember, it was not the case in v3 and earlier).<br><br>You can either specify this in your Java :<br><br>RuleBaseConfiguration conf = new RuleBaseConfiguration();
<br>conf.setRemoveIdentities( true );<br>RuleBase rulebase = new ReteooRuleBase( conf );<br><br>Or in your rule : <br>rule &quot;foo&quot;<br> &nbsp; &nbsp;when<br> &nbsp; &nbsp; &nbsp; $a : Cheese(name=&quot;Stilton&quot;)<br>
 &nbsp; &nbsp; &nbsp; $b : Cheese(this != $a, name=&quot;Stilton&quot;)<br> &nbsp; &nbsp;then<br> &nbsp; &nbsp; &nbsp; # etc<br>end<br><br>Chris<br><br><div><span class="gmail_quote">2007/10/26, Julian Morrison &lt;<a href="mailto:jmorrison@i-neda.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

jmorrison@i-neda.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Suppose I have a rule like:<br><br>rule &quot;foo&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $a : Cheese(name=&quot;Stilton&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $b : Cheese(name=&quot;Stilton&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # etc<br>end<br><br>First question: is it possible that a == b ? In other words, can both
<br>patterns end up matching the same object in one activation? I have been<br>assuming this is so, but it isn&#39;t covered in the docs so far as I can see.<br><br>Second question: why can&#39;t I add as a pattern, $a != $b ? The eclipse
<br>IDE compiler complains they are undefined. What is the scope of the<br>bindings defined by $a and $b ?<br><br>--<br>Julian Morrison<br>Programmer<br>i-neda Ltd.<br><br>_______________________________________________<br>



rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">


https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote></div><br>