to invoke function cast to javax.script.Invocable instead of com.sun.script.javascript.RhinoScriptEngine