public static Object eval(String script, Object input) throws ScriptException {
        if (engine == null) {
            engine = new ScriptEngineManager().getEngineByName("Nashorn");
        }
        if (engine == null) {
            throw new RuntimeException(
                    "missing nashorn engine.  Ensure you are running supported JVM");
        }
        Bindings bindings = engine.createBindings();
        bindings.put("$", input);
        return engine.eval(script, bindings);
    }
Evaluates the script with the help of input provided.

@param script Script to be evaluated.
@param input Input parameters.
@throws ScriptException
@return Generic object, the result of the evaluated expression.
core/src/main/java/com/netflix/conductor/core/events/ScriptEvaluator.java