if (!hasText(getScriptEngineType()) || !hasText(getScriptSourceCode()) && !hasText(getScriptExternalUrl()))
return executed;
Map<String, Object> fields = getFieldsMap(widgetsDefinitionElement.getWidgets());
fields.put("process", processInstance);
ScriptProcessorRegistry registry = ProcessToolContext.Util.getThreadProcessToolContext().getRegistry().lookupService(
ScriptProcessorRegistry.class.getName());
// TODO: some smart cacheing
InputStream is = loadScriptCode();
ScriptProcessor scriptProcessor = registry.getScriptProcessor(getScriptEngineType());
if (scriptProcessor == null) {
logger.severe("Script processor not found: " + getScriptEngineType() + ", skipping script execution. ");
return executed;
}
scriptProcessor.process(fields, is);