Continuing trying to upgrade from drools 5.1 I’ve been finding some strange funnies in rules behavior. Currently I’m using
<droolsVersion>5.3.0.Beta1</droolsVersion>
<jbpmVersion>5.1.0.Final</jbpmVersion>
<mvelVersion>2.1.Beta6</mvelVersion>
In our model we’ve got some lists (Yuck I know) and we want to test whether they are not empty, there are three variations of the rules that we could use
rule
"TESTa"
when
t : Title(t.getMyList().isEmpty() ==
false)
then
logger.debug(drools.getRule().getName() +
" " + drools.getTuple());
end
rule
"TESTb"
when
t : Title(myList.isEmpty() ==
false)
then
logger.debug(drools.getRule().getName() +
" " + drools.getTuple());
end
rule
"TESTc"
when
t : Title(myList.empty
== false)
then
logger.debug(drools.getRule().getName() +
" " + drools.getTuple());
end
I’d expect all of these formats to work (particularly c) however only TESTa succeeds, the other two FAIL SILENTLY, failing to match anything but not generating any errors or warnings.
Thomas