<br>&nbsp;&nbsp;&nbsp; Arjun,<br><br>&nbsp;&nbsp;&nbsp; I guess your questions are about 2 different subjects.<br><br>1. The non-existence of an object is handled by the NOT CE. So, if you want to say: there is no Bus asserted into working memory, you simply say:
<br><br>not Bus()<br><br>If you want to say: there is no red bus asserted into working memory, you simply say:<br><br>not Bus( color == &quot;red&quot; )<br><br>In the above case, even if there is a blue bus asserted, but not a red one, the CE will evaluate to true. 
<br>If you want to say: there is a MyComposedObject whose active attribute is false or none MyComposedObject at all, you could say something like:<br><br>when<br>&nbsp;&nbsp;&nbsp; MyComposedObject(active == false) or<br>&nbsp;&nbsp;&nbsp; not MyComposedObject()
<br>Then<br>&nbsp;&nbsp;//Action<br>End<br><br><a href="http://labs.jboss.com/file-access/default/members/drools/freezone/docs/4.0.0.13773GA/html/ch06s05.html#d0e3622">http://labs.jboss.com/file-access/default/members/drools/freezone/docs/4.0.0.13773GA/html/ch06s05.html#d0e3622
</a><br><br>2. The use of contains and memberOf constraints. They both work on collections and arrays. The &quot;in&quot; operator only works on explicit lists of values:<br><br>Composer( this contains &quot;abc&quot; ) // valid
<br>Composer( this contains $anotherObject ) // valid<br>Component( this memberOf $composer.components )&nbsp; // valid <br>Cheese( type in ( &quot;stilton&quot;, $muzzarela, Cheese.PROVOLONE ) ) // valid<br><br>&nbsp;&nbsp;&nbsp; The negation of all of these operators works the same.
<br><br><a href="http://labs.jboss.com/file-access/default/members/drools/freezone/docs/4.0.0.13773GA/html/ch06s05.html#d0e2992">http://labs.jboss.com/file-access/default/members/drools/freezone/docs/4.0.0.13773GA/html/ch06s05.html#d0e2992
</a><br><br><div><span class="gmail_quote">&nbsp;&nbsp;&nbsp; Please, read the docs and suggest improvements for everything that is not clear there.<br><br>&nbsp;&nbsp;&nbsp; Thanks,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br>&nbsp;<br><br>2007/8/2, Arjun Dhar &lt;<a href="mailto:dhar_ar@yahoo.com">
dhar_ar@yahoo.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> &lt;mark.mcnally &lt;at&gt; <a href="http://comcast.net">comcast.net
</a>&gt; writes:<br><br>&gt;<br>&gt; My rule now appears to be working after switching from the &quot;excludes&quot;<br>operator to the newer &quot;not contains&quot;.<br>&gt;<br>&gt; This works:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; $ca:CandidateAssociation(
nurseDetails.stateLicensures not contains<br>patientDetails.state&nbsp;&nbsp;)<br>&gt;<br>&gt; This does not:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; $ca:CandidateAssociation(nurseDetails.stateLicensures excludes<br>patientDetails.state&nbsp;&nbsp;)<br>&gt;<br>&gt; Mark
<br><br><br>I was just about to post a question and I think this may be the answer to my<br>problem as well. So let me confirm.<br><br>Question) I hvae a rule<br><br>When<br> obj: MyComposedObject(active == false)<br>Then
<br>&nbsp;&nbsp;//Action<br>End<br><br>.. the problem is, if the above object was never asserted; I still want it to<br>execute. Luckily MyComposedObject is&nbsp;&nbsp;composend inside another object, so can i<br>use the technique above as&gt;
<br><br>When<br> obj: Composer( this not contains MyComposedObject)<br>End<br><br>or even obj: Composer( this not in MyComposedObject)<br><br><br>... My Composer simply composes the object and does not contain it in a list.
<br><br>Q1) So would either or both &quot;not contains&quot; or &quot;not in&quot; work?<br>Q2) Or is &quot;not contains&quot; only for List or Collection type? what about HashMaps<br>then?<br>Q3) Stretching my actual use case to its limits; if I want to write conditions
<br>over objects that were never asserted into the working memory (need to OR them<br>with existing) ones, how do I do that? I understand technically it does not<br>make sense to want conditions over objects one never asserted; ... but please
<br>think a moment. A person asserts Objects and due to some external factor some<br>objects do not get asserted. Since he is aware of it, can he trap that<br>conidtion in the rule itself?<br>Example: Assertions --&gt; (Object Type) A1, A2, A4
<br><br>RULES: I never got Object type A3 so Do Notify Admin &lt;-- How to write such a<br>rule?<br><br>I hope I&#39;m able to express my use case.<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div>
<br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">
www.jboss.com</a>