Ahh, cool,
Wish I had known that before, I've had to use some horrible regex "a|b|c"
matches expressions in my current spreadsheet where this may have been easier.
Thomas
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of Edson Tirelli
Sent: 23 June 2010 15:38
To: Rules Users List
Subject: Re: [rules-users] "Not exists" on at least one element from the set
Actually he can. Just use a simple trick and the mvel inline collection syntax:
$name: String() from return( ["a", "b", "c" ] )
Just to explain: in MVEL, you can inline create a collection by using [ ]. The DRL
syntax does not allow you to use [] directly, but you can use a "return"
statement to wrap the [] and return the collection created inline.
Yes, I know that ideally we should not need the "return", but for now, the
parser requires it and due to some ambiguities in the grammar we could not get rid of this
limitation yet. Maybe in the future.
Edson
2010/6/23 Swindells, Thomas <TSwindells@nds.com<mailto:TSwindells@nds.com>>
I don't think you can unfortunately.
You've got a number of options:
1. define a global (in sheet headers) and insert the actual values from code (perhaps
reading from the spreadsheet).
2. Define a custom datatype "Name", have a table with which each row inserts a
Name object with associated value and then use it in your when clause like any other
fact.
3. Have a separate row for each name, use activation groups or inserting a lock/latch
object, or insert logical chaining so that the then part is only executed once.
Thomas
-----Original Message-----
From:
rules-users-bounces@lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org>
[mailto:rules-users-<mailto:rules-users->
bounces@lists.jboss.org<mailto:bounces@lists.jboss.org>] On Behalf Of LeoIo
Sent: 23 June 2010 15:09
To: rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>
Subject: Re: [rules-users] "Not exists" on at least one element from the set
Thanks for the fast response.
I am using excel decision tables and can't set globals with values from the
cells.
I can only use brown fields and through $param refer to the contents of the
cell.
That leads me to a question.
Can I define $collection in the when statement?
something like this:
when
exists (
$name: String from ('a','b','c')
not Object(name == $name)
)
then
Much obliged.
--
View this message in context:
http://drools-java-rules-
engine.46999.n3.nabble.com/Not-exists-on-at-least-one-element-from-the-se...
tp916375p916887.html
Sent from the Drools - User mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org<mailto:rules-users@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@nds.com<mailto:postmaster@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
**************************************************************************************
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @
www.jboss.com<http://www.jboss.com>
________________________________
**************************************************************************************
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
**************************************************************************************