throw new FlowExecutionException("TaskExecutor rejected task for flow=" + flow.getName());
/** * @see AbstractJob#doExecute(JobExecution) */ @Override protected void doExecute(final JobExecution execution) throws JobExecutionException { try { JobFlowExecutor executor = new JobFlowExecutor(getJobRepository(), new SimpleStepHandler(getJobRepository()), execution); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
/** * Test method for {@link FlowExecutionException#FlowExecutionException(String, Throwable)}. */ @Test public void testFlowExecutionExceptionStringThrowable() { FlowExecutionException exception = new FlowExecutionException("foo", new RuntimeException("bar")); assertEquals("foo", exception.getMessage()); assertEquals("bar", exception.getCause().getMessage()); }
/** * Test method for {@link FlowExecutionException#FlowExecutionException(String)}. */ @Test public void testFlowExecutionExceptionString() { FlowExecutionException exception = new FlowExecutionException("foo"); assertEquals("foo", exception.getMessage()); }
@Test public void testNoMatchForNextStep() throws Exception { flow.setStateTransitions(collect(StateTransition.createStateTransition(new StubState("step1"), "FOO", "step2"), StateTransition.createEndStateTransition(new StubState("step2")))); flow.afterPropertiesSet(); try { flow.start(executor); fail("Expected JobExecutionException"); } catch (FlowExecutionException e) { // expected String message = e.getMessage(); assertTrue("Wrong message: " + message, message.toLowerCase().contains("next state not found")); } }
throw new FlowExecutionException(String.format("No transitions found in flow=%s for state=%s", getName(), stateName)); throw new FlowExecutionException(String.format("Next state not found in flow=%s for state=%s with exit status=%s", getName(), stateName, status.getName())); throw new FlowExecutionException(String.format("Next state not specified in flow=%s for next=%s", getName(), next));
/** * @see AbstractJob#doExecute(JobExecution) */ @Override protected void doExecute(final JobExecution execution) throws JobExecutionException { try { JobFlowExecutor executor = new JsrFlowExecutor(getJobRepository(), new JsrStepHandler(getJobRepository(), jobExplorer), execution); State startState = ((JsrFlow)flow).getStartState(); validateFirstStep(startState); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
throw new FlowExecutionException(String.format("Ended flow=%s at state=%s with exception", name, stateName), e);
/** * Delegate to the flow provided for the execution of the step. * * @see AbstractStep#doExecute(StepExecution) */ @Override protected void doExecute(StepExecution stepExecution) throws Exception { try { stepExecution.getExecutionContext().put(STEP_TYPE_KEY, this.getClass().getName()); StepHandler stepHandler = new SimpleStepHandler(getJobRepository(), stepExecution.getExecutionContext()); FlowExecutor executor = new JobFlowExecutor(getJobRepository(), stepHandler, stepExecution.getJobExecution()); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); stepExecution.upgradeStatus(executor.getJobExecution().getStatus()); stepExecution.setExitStatus(executor.getJobExecution().getExitStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
throw new FlowExecutionException(String.format("No transitions found in flow=%s for state=%s", getName(), stateName)); throw new FlowExecutionException(String.format( "Next state not found in flow=%s for state=%s with exit status=%s", getName(), stateName, status.getName())); throw new FlowExecutionException(String.format("Next state not specified in flow=%s for next=%s", getName(), next));
/** * @see AbstractJob#doExecute(JobExecution) */ @Override protected void doExecute(final JobExecution execution) throws JobExecutionException { try { JobFlowExecutor executor = new JobFlowExecutor(getJobRepository(), new SimpleStepHandler(getJobRepository()), execution); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
throw new FlowExecutionException("TaskExecutor rejected task for flow=" + flow.getName());
/** * @see AbstractJob#doExecute(JobExecution) */ @Override protected void doExecute(final JobExecution execution) throws JobExecutionException { try { JobFlowExecutor executor = new JobFlowExecutor(getJobRepository(), new SimpleStepHandler(getJobRepository()), execution); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
throw new FlowExecutionException("TaskExecutor rejected task for flow=" + flow.getName());
/** * @see AbstractJob#doExecute(JobExecution) */ @Override protected void doExecute(final JobExecution execution) throws JobExecutionException { try { JobFlowExecutor executor = new JobFlowExecutor(getJobRepository(), new SimpleStepHandler(getJobRepository()), execution); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
throw new FlowExecutionException("TaskExecutor rejected task for flow=" + flow.getName());
/** * @see AbstractJob#doExecute(JobExecution) */ @Override protected void doExecute(final JobExecution execution) throws JobExecutionException { try { JobFlowExecutor executor = new JobFlowExecutor(getJobRepository(), new SimpleStepHandler(getJobRepository()), execution); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
throw new FlowExecutionException(String.format("No transitions found in flow=%s for state=%s", getName(), stateName)); throw new FlowExecutionException(String.format("Next state not found in flow=%s for state=%s with exit status=%s", getName(), stateName, status.getName())); throw new FlowExecutionException(String.format("Next state not specified in flow=%s for next=%s", getName(), next));
/** * @see AbstractJob#doExecute(JobExecution) */ @Override protected void doExecute(final JobExecution execution) throws JobExecutionException { try { JobFlowExecutor executor = new JsrFlowExecutor(getJobRepository(), new JsrStepHandler(getJobRepository(), jobExplorer), execution); State startState = ((JsrFlow)flow).getStartState(); validateFirstStep(startState); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
throw new FlowExecutionException("TaskExecutor rejected task for flow=" + flow.getName());