use of com.cognifide.apm.core.services.event.ApmEvent.ScriptExecutedEvent in project APM by Cognifide.
the class ScriptManagerImpl method process.
@Override
public Progress process(Script script, final ExecutionMode mode, final Map<String, String> customDefinitions, ResourceResolver resolver) throws RepositoryException, PersistenceException {
Progress progress;
try {
progress = execute(script, mode, customDefinitions, resolver);
} catch (ExecutionException e) {
progress = new ProgressImpl(resolver.getUserID());
progress.addEntry(Status.ERROR, e.getMessage());
}
updateScriptProperties(script, mode, progress.isSuccess());
versionService.updateVersionIfNeeded(resolver, script);
saveHistory(script, mode, progress);
eventManager.trigger(new ScriptExecutedEvent(script, mode, progress.isSuccess()));
return progress;
}
Aggregations