Hi all,<br><br>I don&#39;t know exactly why I have a problem in my &quot;exists&quot; 
function. I&#39;ve tried
 many different ways, but it does not work. Anybody could help me, 
please?<div class="im"><br><br>I
 have the following rules:<br><br><i>rule &quot;diff&quot;<br>when<br>    $var1: 
EReference(name == &quot;employee&quot;)<br>    $var2: EClass(name == &quot;Company&quot;, 
EAllReferences contains $var1)<br>    <b style="color: rgb(0, 0, 153);">not


 (exists( EPackage(EClassifiers contains $var2 ) ))</b><br>then<br>    
insertLogical(new IntConstraintOccurrence(&quot;diff&quot;, 10));<br>end<br><br>rule


 &quot;ClassesNotReferenced&quot;<br>    when<br>        $q1 : EClass();<br>       


 $q2 : EPackage(EClassifiers contains $q1);<br>        not( exists ( 
EReference(EType == $q1) ));<br>    then<br>        insertLogical(new 
IntConstraintOccurrence(&quot;ClassesNotReferenced&quot;, 1, $q1));<br>end</i><br><br><br></div>and


 in my facts (and my EPackage) I have 4 instances of EClass 
&quot;Company&quot; with a EReference &quot;employee&quot;, and another EClass &quot;Person&quot;.  I 
still have a &quot;move&quot; that removes EClasses in my Drools Solver.<br><br>I 
need to have only one classe &quot;Company&quot; after processing. But it 
removes only the EClass &quot;Person&quot;, when it was supposed to remove one 
EClass 
&quot;Person&quot; and 3 ECLasses &quot;Company&quot;. Leaving one EClass &quot;Company&quot; in the 
end.<br><br>The

 problem is:  when Drools tries to remove a EClass &quot;Person&quot; it thinks that 
 the EClass &quot;Company&quot; does not exists. But in fact there are 3 others.<br><br>Any
 clue about it, please ?<br><br>Thanks<br><br>Bests regards<br><br>Antonio<br><br><br>