Search code examples
javadroolsjava-17

org.drools.core.util.MVELSafeHelper is not available in 7.74.1.Final drools version


I'm updating drools version from 7.20.0.Final to 7.74.1.Final. After update the dependency to 7.74.1.Final, I got an error saying couldn't find org.drools.core.util.MVELSafeHelper.

I have following code and need to do this without MVELSafeHelper.

    class Checker {

        private Object processTypeDataValue(String key, Object value) {
            if (!(value instanceof String)) {
                return value;
            }

            try {
                return MVELSafeHelper.getEvaluator().eval((String) value);
            } catch (Exception e) {
                log.warn("Problem evaluating metadata through MVEL", e);
                return value;
            }
        }

    }

Any alternative way to do this without MVELSafeHelper?


Solution

  • This is probably a duplicate of: drools-mvel is not present after the upgrade of the drools-decisiontables library from 7.67 to 8.31 due to that MissingDependencyException occurring

    The MVEL integration with Drools was moved to a drools-mvel artifact. Try adding the following dependency to your project:

    <dependency>
          <groupId>org.drools</groupId>
          <artifactId>drools-mvel</artifactId>
          <version>7.74.1</version>
    </dependency>