/** * Build a job that executes the flow provided, normally composed of other steps. * * @return a flow job */ public Job build() { FlowJob job = new FlowJob(); job.setName(getName()); job.setFlow(flow); super.enhance(job); try { job.afterPropertiesSet(); } catch (Exception e) { throw new StepBuilderException(e); } return job; }
@Test public void testGetStepNamesWithPrefix() throws Exception { SimpleFlow flow = new SimpleFlow("job"); List<StateTransition> transitions = new ArrayList<>(); transitions.add(StateTransition.createStateTransition(new StepState("job.step", new StubStep("step")), "end0")); transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0"))); flow.setStateTransitions(transitions); flow.afterPropertiesSet(); job.setFlow(flow); job.setName(flow.getName()); job.afterPropertiesSet(); assertEquals("[step]", job.getStepNames().toString()); }
@Test public void testGetStepExistsWithPrefix() throws Exception { SimpleFlow flow = new SimpleFlow("job"); List<StateTransition> transitions = new ArrayList<>(); transitions.add(StateTransition.createStateTransition(new StepState("job.step", new StubStep("step")), "end0")); transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0"))); flow.setStateTransitions(transitions); flow.afterPropertiesSet(); job.setFlow(flow); job.setName(flow.getName()); job.afterPropertiesSet(); Step step = job.getStep("step"); assertNotNull(step); assertEquals("step", step.getName()); }
/** * Build a job that executes the flow provided, normally composed of other steps. * * @return a flow job */ public Job build() { FlowJob job = new FlowJob(); job.setName(getName()); job.setFlow(flow); super.enhance(job); try { job.afterPropertiesSet(); } catch (Exception e) { throw new StepBuilderException(e); } return job; }
/** * Build a job that executes the flow provided, normally composed of other steps. * * @return a flow job */ public Job build() { FlowJob job = new FlowJob(); job.setName(getName()); job.setFlow(flow); super.enhance(job); try { job.afterPropertiesSet(); } catch (Exception e) { throw new StepBuilderException(e); } return job; }
/** * Build a job that executes the flow provided, normally composed of other steps. * * @return a flow job */ public Job build() { FlowJob job = new FlowJob(); job.setName(getName()); job.setFlow(flow); super.enhance(job); try { job.afterPropertiesSet(); } catch (Exception e) { throw new StepBuilderException(e); } return job; }