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 "foo"<br> when<br> $a : Cheese(name="Stilton")<br>
$b : Cheese(this != $a, name="Stilton")<br> then<br> # etc<br>end<br><br>Chris<br><br><div><span class="gmail_quote">2007/10/26, Julian Morrison <<a href="mailto:jmorrison@i-neda.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
jmorrison@i-neda.com</a>>:</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 "foo"<br> when<br> $a : Cheese(name="Stilton")<br> $b : Cheese(name="Stilton")<br> then<br> # 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't covered in the docs so far as I can see.<br><br>Second question: why can'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>