Hi,<br><br>Thank you very much for all replies.<br><br>I've tried also with not ( EPackage(...)), but the result is the same.<br><br>I think that I remove the EClass from the facts in my solution, but they continue in my workingMemory. <br>
<br>How I can see the facts of the workingMemory object (and how remove it)?<br><br>Thanks<br><br>Best regards<br><br>Antonio<br><br><div class="gmail_quote">2010/5/5 <span dir="ltr"><<a href="mailto:fgadrat@genigraph.fr">fgadrat@genigraph.fr</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Antonio,<br>Documentation states that the complement to "not" is "exists",
whereas "not" keyword is used to match the absence of a fact (in Working
Memory), and "exists" keyword is used to test the existence of one or
more facts (in Working memory).<br> <br>
So if you want to test that a fact is not in working memory, then you
should use the <br>
not(MyClass()) pattern.<br> <br>
Hope this helps,<br>
Francois.<br> <br>
Antonio Neto <<a href="mailto:antoniosouzaneto@gmail.com" target="_blank">antoniosouzaneto@gmail.com</a>> a écrit :<div><div></div><div class="h5"><br> <br>
> Any idea? Please...<br>
><br>
> 2010/5/4 Antonio Neto <<a href="mailto:antoniosouzaneto@gmail.com" target="_blank">antoniosouzaneto@gmail.com</a>><br>
><br>
>> Hi all,<br>
>><br>
>> I don't know exactly why I have a problem in my "exists" function. I've<br>
>> tried many different ways, but it does not work. Anybody could help me,<br>
>> please?<br>
>><br>
>><br>
>> I have the following rules:<br>
>><br>
>> *rule "diff"<br>
>> when<br>
>> $var1: EReference(name == "employee")<br>
>> $var2: EClass(name == "Company", EAllReferences contains $var1)<br>
>> not (exists( EPackage(EClassifiers contains $var2 ) ))<br>
>> then<br>
>> insertLogical(new IntConstraintOccurrence("diff", 10));<br>
>> end<br>
>><br>
>> rule "ClassesNotReferenced"<br>
>> when<br>
>> $q1 : EClass();<br>
>> $q2 : EPackage(EClassifiers contains $q1);<br>
>> not( exists ( EReference(EType == $q1) ));<br>
>> then<br>
>> insertLogical(new IntConstraintOccurrence("ClassesNotReferenced",<br>
>> 1, $q1));<br>
>> end*<br>
>><br>
>><br>
>> and in my facts (and my EPackage) I have 4 instances of EClass "Company"<br>
>> with a EReference "employee", and another EClass "Person". I still have a<br>
>> "move" that removes EClasses in my Drools Solver.<br>
>><br>
>> I need to have only one classe "Company" after processing. But it removes<br>
>> only the EClass "Person", when it was supposed to remove one EClass "Person"<br>
>> and 3 ECLasses "Company". Leaving one EClass "Company" in the end.<br>
>><br>
>> The problem is: when Drools tries to remove a EClass "Person" it thinks<br>
>> that the EClass "Company" 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>
>><br>
><br></div></div><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>
<br></blockquote></div><br>