&quot;or&quot; causes two rules to be generated internally hence the double activation you report.<br><br>i.e. the following are generated internally:-<br><br>rule &quot;internal 1&quot;<br>when<br>    Person  ( gender == &quot;Female&quot; )<br>
then<br>    resultIds.add(&quot;id_1000&quot;)<br>end<br><br>rule &quot;internal 2&quot;<br>
when<br>
    Procedure( needToDone == &quot;ABC&quot; )<br>
then<br>
    resultIds.add(&quot;id_1000&quot;)<br>
end<br>
<br>There are different ways to tackle the duplicate; (1) prevent it from occurring in the first instance, (2) remove duplicates afterwards, both of which are simplified if &quot;resultIds&quot; becomes a Fact rather than presumably a global (although still possible).<br>
<br>(1)<br><br>rule &quot;rule&quot;<br>when<br>    (<br>        Person  ( gender == &quot;Female&quot; )<br>        or<br>        Procedure( needToDone == &quot;ABC&quot; )<br>    )<br>   

not ResultId( value == &quot;id_1000&quot; )<br>
then<br>
    insert(new ResultId(&quot;id_1000&quot;));<br>
end<br>
<br>(2) <br>rule &quot;rule&quot;<br>salience 0<br>

when<br>

    Person  ( gender == &quot;Female&quot; )<br>
    or<br>

    Procedure( needToDone == &quot;ABC&quot; )<br>then<br>

    insert(new ResultId(&quot;id_1000&quot;));<br>

end<br><br>rule &quot;remove duplicates&quot;<br>salience 1000<br>when<br>    $orig : ResultId( $v : value)<br>    $dup : ResultId( this != $orig, value == $v )<br>then<br>    remove( $dup )<br>end<br>  <br>

<br><div class="gmail_quote">On 10 February 2011 23:14, kashif10 <span dir="ltr">&lt;<a href="mailto:kash452@yahoo.com">kash452@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<br>
1) If I have a Rule definition<br>
<br>
when<br>
#conditions<br>
<br>
 Person( gender  == &quot;Female&quot;)<br>
 or<br>
 Procedure( needToDone == &quot;ABC&quot;))<br>
<br>
<br>
then<br>
resultIds.add(&quot;id_1000&quot;);<br>
<br>
<br>
Is it not short circuit If first condiiton matches?<br>
I get twice time &quot;id_1000&quot; in resultIds.<br>
<br>
<br>
<br>
2) How can I chekc the multiple existence<br>
For Example:<br>
<br>
How can I chekc that multiple instances of Procddure have alredayDone= &quot;ABC<br>
&quot;<br>
<br>
Rule Definition only chekc once:<br>
Procedure (alredayDone == &quot;ABC&quot;)<br>
<font color="#888888"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Some-Questions-related-to-execution-tp2470079p2470079.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Some-Questions-related-to-execution-tp2470079p2470079.html</a><br>

Sent from the Drools - User mailing list archive at Nabble.com.<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>
</font></blockquote></div><br>