@PostMapping({"", "/"})
	public Map<String, Object> run(@RequestBody Map<String, Object> param) {
		String script = (String) param.getOrDefault("script", "");
		String result = "";

		if (StringUtils.isNotBlank(script)) {
			ScriptEngine engine = new ScriptEngineManager().getEngineByName("Groovy");
			engine.put("applicationContext", this.applicationContext);
			engine.put("agentManager", this.agentManager);
			engine.put("agentService", this.agentService);
			engine.put("regionService", this.regionService);
			engine.put("consoleManager", this.consoleManager);
			engine.put("userService", this.userService);
			engine.put("perfTestService", this.perfTestService);
			engine.put("tagService", this.tagService);
			engine.put("fileEntryService", this.fileEntryService);
			engine.put("config", this.config);
			engine.put("pluginManager", this.pluginManager);
			engine.put("cacheManager", this.cacheManager);
			engine.put("user", this.userContext.getCurrentUser());
			engine.put("hazelcastService", this.hazelcastService);
			final StringWriter out = new StringWriter();
			PrintWriter writer = new PrintWriter(out);
			engine.getContext().setWriter(writer);
			engine.getContext().setErrorWriter(writer);

			try {
				Object evalResult = engine.eval(script);
				result = Objects.toString(evalResult, "");
			} catch (ScriptException e) {
				result = e.getMessage();
			} finally {
				String outString = out.toString();
				if (StringUtils.isNotEmpty(outString)) {
					result = outString + "\n" + result;
				}
			}
		}
		return buildMap("result", result);
	}
Run the given script. The run result is stored in "result" of the given model.

@param param script json
@return script run result
ngrinder-controller/src/main/java/org/ngrinder/operation/cotroller/ScriptConsoleApiController.java