context.put("parameters", params);
context.put("dctx", dispatcher.getLocalContext(localName));
context.put("dispatcher", dispatcher);
context.put("delegator", dispatcher.getDelegator());
try {
Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(this.getLocation(modelService)), GroovyUtil.getBinding(context));
Object resultObj = null;
if (UtilValidate.isEmpty(modelService.invoke)) {
resultObj = script.run();
} else {
resultObj = script.invokeMethod(modelService.invoke, EMPTY_ARGS);
}
if (resultObj != null && resultObj instanceof Map<?, ?>) {
return cast(resultObj);
} else if (context.get("result") != null && context.get("result") instanceof Map<?, ?>) {
return cast(context.get("result"));