private void executeAll(Iterator<WorkflowNode> iterator, ApplicationSpecification appSpec, InstantiatorFactory instantiator, ClassLoader classLoader, WorkflowToken token) { while (iterator.hasNext() && runningThread != null) { try { blockIfSuspended(); WorkflowNode node = iterator.next(); executeNode(appSpec, node, instantiator, classLoader, token); } catch (Throwable t) { Throwable rootCause = Throwables.getRootCause(t); if (rootCause instanceof InterruptedException) { LOG.debug("Workflow '{}' with run id '{}' aborted", workflowSpec.getName(), workflowRunId.getRun()); workflowContext.setState(new ProgramState(ProgramStatus.KILLED, rootCause.getMessage())); break; } workflowContext.setState(new ProgramState(ProgramStatus.FAILED, rootCause.getMessage())); throw Throwables.propagate(rootCause); } } }
private void executeAll(Iterator<WorkflowNode> iterator, ApplicationSpecification appSpec, InstantiatorFactory instantiator, ClassLoader classLoader, WorkflowToken token) { while (iterator.hasNext() && runningThread != null) { try { blockIfSuspended(); WorkflowNode node = iterator.next(); executeNode(appSpec, node, instantiator, classLoader, token); } catch (Throwable t) { Throwable rootCause = Throwables.getRootCause(t); if (rootCause instanceof InterruptedException) { LOG.debug("Workflow '{}' with run id '{}' aborted", workflowSpec.getName(), workflowRunId.getRun()); workflowContext.setState(new ProgramState(ProgramStatus.KILLED, rootCause.getMessage())); break; } workflowContext.setState(new ProgramState(ProgramStatus.FAILED, rootCause.getMessage())); throw Throwables.propagate(rootCause); } } }