//Rhino engine Ok.
Context cx = Context.enter();
Scriptable scope = cx.initStandardObjects();
//Load javascript factory with javascript functions from file, stringinput and paraminput
String jsResult = "";
try {
cx.evaluateString(scope, javascriptcode, "jsScript", 1, null);
Function fct = (Function)scope.get(jsfunctionName, scope);
Object result = fct.call(cx, scope, scope, new Object[]{jsfunctionArguments});
if(isDebug()) {
System.out.println(cx.jsToJava(result, String.class));
};
jsResult = (String) cx.jsToJava(result, String.class);
} catch (org.mozilla.javascript.EcmaError ex) {
throw new PipeRunException(this, "org.mozilla.javascript.EcmaError -> ", ex);
//System.out.println(ex.getMessage());
}finally {
cx.exit();
}
//Use the result
if (!(jsResult instanceof String)) {
}else{
if((String)jsResult != null){
stringResult = (String)jsResult;
}
}
thanks,
Black