[rules-users] question on syntax with FROM keyword

Eric Miles eric.miles at kronos.com
Fri Nov 2 12:51:01 EDT 2007


I'm trying to use the FROM keyword in a way that I think it should be
able to be used, but I'm getting compilation errors.  Here are the 2
ways that I'm getting stumped on:

exist SomeObject(val == "5") from dao.find(99)


and

not AnotherObject(val == "Dad") from anotherDao.find(1)


If I remove the exist and not, everything compiles okay.  With the first
test, I'd like to ensure an object exists AND it has a value of 5.
dao.find could return a null, so I don't want the test to crap out
because of a NullPointerException.

With the second one, I want to ensure the collection returned from
anotherDao.find call does not have an AnotherObject instance with a
value of "Dad".

These seem like fairly trivial things to test for, so I'm fairly certain
there's an appropriate way to structure these test.  Any help is
appreciated.

Thanks all.

Eric



More information about the rules-users mailing list