<br>   Yap, that or, in case you want to do it automatically for ALL your rules, you could use:<br><br>KnowledgeBaseConfiguration conf = ...<br>conf.setOption( RemoveIdentitiesOption.YES );<br><br>   Javadocs:<br><br><a href="http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/apidocs/org/drools/KnowledgeBaseConfiguration.html">http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/apidocs/org/drools/KnowledgeBaseConfiguration.html</a><br>
<a href="http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/apidocs/org/drools/conf/RemoveIdentitiesOption.html">http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/apidocs/org/drools/conf/RemoveIdentitiesOption.html</a><br>
<br>   Edson<br><br><div class="gmail_quote">2009/11/6 Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</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 class="im">D Brock wrote:<br>
&gt; I have defined the following rule to detect when duplicate objects (in this<br>
&gt; example, Widgets) exist.  This always produces two matches, and therefore<br>
&gt; two messages.  I understand why this occurs, but I would like for only one<br>
&gt; message to be reported.  I cannot retract one of the widgets after a match<br>
&gt; b/c all are needed for additional rules matching.  Is the a conventional way<br>
&gt; for accomplishing the elimination of the reciprocal match?<br>
&gt;<br>
&gt; rule &quot;Do not allow duplicate widgets&quot;<br>
&gt;       when<br>
&gt;               $w : Widget( $name : name )<br>
&gt;               Widget( this != $w, name == $name )<br>
&gt;       then<br>
&gt;               System.out.println( &quot;Duplicate widgets found with name =  &quot; + $name );<br>
&gt; end<br>
&gt;<br>
</div>We are looking into a new conditional element that can achieve this. The<br>
idea is when you use this CE, it ensures only a single permutation will<br>
be propagated. In the meantime you can probably try something like:<br>
<br>
$w : Widget( $name : name )<br>
     Widget( this != $w, hashCode &lt; $w.hashCode, name == $name )<br>
<div><div></div><div class="h5"><br>
<br>
<br>
<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>