I'm attempting to use projections (list comprehension) in a mvel rule consequence, however it fails to compile.
foo = (toUpperCase() in ["a", "b", "c"]);
Error: unable to resolve method using strict-mode: org.drools.core.spi.KnowledgeHelper.toUpperCase()
Setting the system property "drools.dialect.mvel.strict=false" will work around this problem, but I'm reluctant to do this system wide in case there is a negative performance impact (I don't know if that's a valid concern).
Another workaround is to declare a variable named "$", but this is also not ideal since that would limit the use of one projection in the current scope since the "$" variable can't be declared again to change the type.
String $ = null;
foo = ($.toUpperCase() in ["a", "b", "c"]);
Is there a different variable name other than "$" for accessing the list element in a projections statement like this? Or some other workaround? Should I just disable strict mode?