use of org.cristalise.kernel.scripting.Parameter in project kernel by cristal-ise.
the class AgentProxy method callScript.
@SuppressWarnings("rawtypes")
private ErrorInfo callScript(ItemProxy item, Job job) throws ScriptingEngineException, InvalidDataException, ObjectNotFoundException {
Script script = job.getScript();
if (script.getOutputParams().size() == 1) {
Parameter p = script.getOutputParams().values().iterator().next();
if (p.getType() == ErrorInfo.class) {
script.setActExecEnvironment(item, this, job);
Object returnVal = script.execute();
if (returnVal instanceof Map)
return (ErrorInfo) ((Map) returnVal).get(p.getName());
else
return (ErrorInfo) returnVal;
}
}
throw new InvalidDataException("Script " + script.getName() + " must define single output of type org.cristalise.kernel.scripting.ErrorInfo");
}
Aggregations