decoder-js/src/main/java/com/hpe/caf/decoder/JavascriptDecoder.java
private static String invokeStringMethod(final ScriptEngine jsEngine, final Object thiz, final String name, final Object... args)
        throws NoSuchMethodException, ScriptException
    {
        return (String) ((Invocable) jsEngine).invokeMethod(thiz, name, args);
    }
private static String invokeStringMethod(final ScriptEngine jsEngine, final Object thiz, final String name, final Object... args)
        throws NoSuchMethodException, ScriptException
    {
        return (String) ((Invocable) jsEngine).invokeMethod(thiz, name, args);
    }
Calls a method on a script object compiled during a previous script execution, which is retained in the state of the ScriptEngine.

@param jsEngine the JavaScript engine
@param thiz the instance of the class that contains the method to be called
@param name the name of the method to be called
@param args the arguments to pass to the method
@return the value returned by the procedure, which must be a String
@throws NoSuchMethodException if method with given name or matching argument types cannot be found.
@throws ScriptException if an error occurs during invocation of the method.