So what you are trying to say is that you want a rule to fire if there exists a name from
(a, b, c) such that there are no object with that name?
Which is probably something like the following:
global $collection (which is set to the list
exists (
$name: String from $collection
not Object(name == $name)
)
Then
...
You'll probably have to fix the syntax but that may get you closer.
Thomas
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-
bounces(a)lists.jboss.org] On Behalf Of LeoIo
Sent: 23 June 2010 10:25
To: rules-users(a)lists.jboss.org
Subject: [rules-users] "Not exists" on at least one element from the set
Hi,
I am desperately trying to figure out how to express the following:
Having a set of object names, say (a,b,c) I want to write a rule firing when
there are no objects in working memory with name equals to at least one name
from the set.
In other words I want to say: fire if there are no objects with name 'a', or
no objects with name 'b' or no objects with name 'c'.
The rule "not Object(name in('a', 'b', 'c'))" only
fires if none of the
objects exist.
What I need is different though.
Any help greatly appreciated.
Thanks a lot.
--
View this message in context:
http://drools-java-rules-
engine.46999.n3.nabble.com/Not-exists-on-at-least-one-element-from-the-set-
tp916375p916375.html
Sent from the Drools - User mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received
this message in error, please immediately notify the postmaster(a)nds.com and delete it from
your system as well as any copies. The content of e-mails as well as traffic data may be
monitored by NDS for employment and security purposes. To protect the environment please
do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United
Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603
8808 40-00
**************************************************************************************