[rules-users] Re: nested accessors with Sets

Arjun Dhar dhar_ar at yahoo.com
Thu Aug 2 01:00:49 EDT 2007


 <mark.mcnally <at> comcast.net> writes:

> 
> My rule now appears to be working after switching from the "excludes"  
operator to the newer "not contains".
> 
> This works:
>     $ca:CandidateAssociation(nurseDetails.stateLicensures not contains 
patientDetails.state  )			
> 
> This does not:
>     $ca:CandidateAssociation(nurseDetails.stateLicensures excludes  
patientDetails.state  )			
> 
> Mark


I was just about to post a question and I think this may be the answer to my 
problem as well. So let me confirm.

Question) I hvae a rule

When
 obj: MyComposedObject(active == false) 
Then
  //Action
End

.. the problem is, if the above object was never asserted; I still want it to 
execute. Luckily MyComposedObject is  composend inside another object, so can i 
use the technique above as>

When
 obj: Composer( this not contains MyComposedObject)
End

or even obj: Composer( this not in MyComposedObject)


... My Composer simply composes the object and does not contain it in a list. 

Q1) So would either or both "not contains" or "not in" work? 
Q2) Or is "not contains" only for List or Collection type? what about HashMaps 
then?
Q3) Stretching my actual use case to its limits; if I want to write conditions 
over objects that were never asserted into the working memory (need to OR them 
with existing) ones, how do I do that? I understand technically it does not 
make sense to want conditions over objects one never asserted; ... but please 
think a moment. A person asserts Objects and due to some external factor some 
objects do not get asserted. Since he is aware of it, can he trap that 
conidtion in the rule itself?
Example: Assertions --> (Object Type) A1, A2, A4

RULES: I never got Object type A3 so Do Notify Admin <-- How to write such a 
rule?

I hope I'm able to express my use case.





More information about the rules-users mailing list