I am struggling to invoke javascript function from java. My problem comes from the fact that whole function is actually received as a string argument:
public void selectMethod(Map<T> item, String function)
where function object is actually the whole java script method. I need to call this method with nashorn
ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");
I need to pass the function with map item as well. When js function modifies the map object I have to print it out in java.
I would appriciate any help.