[rules-users] Trivial rule with condition in RHS won't compile, help please

Barry Kaplan groups1 at memelet.com
Thu Dec 3 14:43:05 EST 2009


The following rule:

rule "test" dialect "mvel"
when
    eval(true)
then
    if (true) {
        System.out.println("***")
    }
end

Fails with:

java.lang.RuntimeException: Unable to build expression for 'consequence':
was expecting type: java.lang.Object; but found type: void '    if (true) {
        System.out.println("***")
    }
    true
' : [Rule name='test']

I can't for the live of me figure out what mvel is bitching about.

Note that the following does compile:

rule "test" dialect "mvel"
when
    eval(true)
then
//    if (true) {
        System.out.println("***")
//    }
end
-- 
View this message in context: http://n3.nabble.com/Trivial-rule-with-condition-in-RHS-won-t-compile-help-please-tp67458p67458.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list