code: private static Object evaluateScript(final ActionContext actionContext, final GraphObject entity, final String engineName, final String script) throws FrameworkException {
  
  		final ScriptEngineManager manager = new ScriptEngineManager();
  		ScriptEngine engine = manager.getEngineByName(engineName);
  
  		if (engine == null) {
  			List<ScriptEngineFactory> factories = manager.getEngineFactories();
  
  			for (ScriptEngineFactory factory : factories) {
  
  				if (factory.getNames().contains(engineName)) {
  
  					engine = factory.getScriptEngine();
  					break;
  
  				}
  
  			}
  
  		}
  
  
  		if (engine == null) {
  			throw new RuntimeException(engineName + " script engine could not be initialized. Check class path.");
  		}
  
  		final ScriptContext scriptContext = engine.getContext();
  		final Bindings bindings           = new StructrScriptBindings(actionContext, entity);
  
  		if (!(engine instanceof RenjinScriptEngine)) {
  			scriptContext.setBindings(bindings, ScriptContext.GLOBAL_SCOPE);
  		} else if (engine instanceof  RenjinScriptEngine) {
  
  			engine.put("Structr", new StructrScriptObject(actionContext, entity));
  
  		}
  
  		StringWriter output = new StringWriter();
  		scriptContext.setWriter(output);
  
  		try {
  
  			Object extractedValue = engine.eval(script);
  
  			if (output != null && output.toString() != null && output.toString().length() > 0) {
  				extractedValue = output.toString();
  			}
  
  			return extractedValue;
  
  		} catch (final Throwable e) {
  
  			if (!actionContext.getDisableVerboseExceptionLogging()) {
  				logger.error("Error while processing {} script: {}", engineName, script, e);
  			}
  
  			throw new FrameworkException(422, e.getMessage());
  		}
  
  	}
docs: ----- private methods -----