@Override public void log(Logger log) { if (this.getExitReason() != null && this.getExitReason().getResult() == ProcessResult.SUCCESS) { return; } else if (this.getExitReason().isRethrow()) { if (this.getExitReason().isError()) { log.error("Exiting with code [{}] : {} : [{}]", this.getExitReason(), this.getCause().getClass().getSimpleName(), this.getCause().getMessage()); } else if (this.getCause() == null) { log.debug("Exiting with code [{}] : {} : [{}]", this.getExitReason(), this.getClass().getSimpleName(), this.getMessage()); } else { log.debug("Exiting with code [{}] : {} : [{}]", this.getExitReason(), this.getCause().getClass().getSimpleName(), this.getCause().getMessage()); } } else if (this.getExitReason().isError()) { log.error("Exiting with code [{}] : {}", this.getExitReason(), this.getMessage(), this.getCause()); } else { log.debug("Exiting with code [{}] : {}", this.getExitReason(), this.getMessage(), this.getCause() != null ? this.getCause().getMessage() : StringUtils.EMPTY); } }
public ProcessRecord getProcessRecord() { record.setPhase(instanceContext.getPhase()); record.setProcessLog(processLog); record.setExitReason(finalReason); if (finalReason == null) { record.setRunningProcessServerId(EngineContext.getProcessServerId()); } else { if (finalReason == ExitReason.RETRY_EXCEPTION) { record.setRunAfter(null); } record.setRunningProcessServerId(null); if (finalReason.isTerminating() && execution != null && execution.getStopTime() != null) { record.setEndTime(new Date(execution.getStopTime())); } record.setResult(finalReason.getResult()); } return record; }
protected ExitReason executeWithProcessInstanceLock() { EngineContext engineContext = EngineContext.getEngineContext(); try { runDelegateLoop(engineContext); return exit(ExitReason.DONE); } catch (ProcessExecutionExitException e) { exit(e.getExitReason()); if (e.getExitReason() != null && e.getExitReason().getResult() == ProcessResult.SUCCESS) { return e.getExitReason(); } if (e.getExitReason().isRethrow()) { Throwable t = e.getCause(); ExceptionUtils.rethrowRuntime(t == null ? e : t); } throw new ProcessInstanceException(this, e); } finally { context.getProcessManager().persistState(this, schedule); } }
public ProcessExecutionExitException(String message, ExitReason exitReason, Throwable t) { super(message == null ? exitReason.toString() : message, t); this.exitReason = exitReason; }
} catch (ProcessInstanceException e) { counters.get(e.getExitReason()).inc(); if (e.getExitReason().isError()) { log.error("Process [{}:{}] on [{}] failed, exit [{}] : {}", instance.getName(), processId, instance.getResourceId(), e .getExitReason(), e.getMessage());
@Override public void log(Logger log) { if (this.getExitReason() != null && this.getExitReason().getResult() == ProcessResult.SUCCESS) { return; } else if (this.getExitReason().isRethrow()) { if (this.getExitReason().isError()) { log.error("Exiting with code [{}] : {} : [{}]", this.getExitReason(), this.getCause().getClass() .getSimpleName(), this.getCause().getMessage()); } else { log.debug("Exiting with code [{}] : {} : [{}]", this.getExitReason(), this.getCause().getClass() .getSimpleName(), this.getCause().getMessage()); } } else if (this.getExitReason().isError()) { log.error("Exiting with code [{}] : {}", this.getExitReason(), this.getMessage(), this.getCause()); } else { log.debug("Exiting with code [{}] : {}", this.getExitReason(), this.getMessage(), this.getCause() != null ? this.getCause().getMessage() : StringUtils.EMPTY); } }