is there Salience and setFocus like feature in MVEL expression Just like Drools

26 Views Asked by At

I am developing a custom rule engine in spring boot + mvel (Not using drools). I have a drools background. I used setFocus() and salience feature to prioritize rules.

I want to do the same using mvel expression. How can I do it ? Also can I run following expression in MVEL ?

    if (10 > 0) {
        System.out.println("Greater than zero!");
    }
    else if (10 > 5) { 
        System.out.println("great than 5!");
    }
    else { 
        System.out.println("Something else!");
}

I am getting nullpointer exception. I read in tutorials that I can use java style if then in mvel.

If I just eval (10 > 5), it returns true but if I does if(10 > 5), again it throws exception.

Thankyou in advance.

0

There are 0 best solutions below