Examples of StepState


Examples of org.springframework.batch.core.job.flow.support.state.StepState

    @Bean
    public SimpleFlow simpleFlow() {
      SimpleFlow simpleFlow = new SimpleFlow("simpleFlow");
      List<StateTransition> transitions = new ArrayList<StateTransition>();
      transitions.add(StateTransition.createStateTransition(new StepState(dummyStep()), "end0"));
      transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0")));
      simpleFlow.setStateTransitions(transitions);
      return simpleFlow;
    }
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  private State createState(Object input) {
    State result;
    if (input instanceof Step) {
      if (!states.containsKey(input)) {
        Step step = (Step) input;
        states.put(input, new StepState(prefix + step.getName(), step));
      }
      result = states.get(input);
    }
    else if (input instanceof JobExecutionDecider) {
      if (!states.containsKey(input)) {
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

    FlowStep step = new FlowStep();
    step.setJobRepository(jobRepository);

    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
    StepState step2 = new StepState(new StubStep("step2"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.FAILED.getExitCode(), "end0"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.COMPLETED.getExitCode(), "end1"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.FAILED, "end0")));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1")));
    flow.setStateTransitions(transitions);
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

    FlowStep step = new FlowStep();
    step.setJobRepository(jobRepository);

    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
    StepState step2 = new StepState(new StubStep("step2", true));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.FAILED.getExitCode(), "end0"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.COMPLETED.getExitCode(), "end1"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.FAILED, "end0")));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1")));
    flow.setStateTransitions(transitions);
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

    FlowStep step = new FlowStep();
    step.setJobRepository(jobRepository);

    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "end0"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0")));
    flow.setStateTransitions(transitions);

    step.setFlow(flow);
    step.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  @Test
  public void testGetSteps() throws Exception {
    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0")));
    flow.setStateTransitions(transitions);
    flow.afterPropertiesSet();
    job.setFlow(flow);
    job.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  @Test
  public void testTwoSteps() throws Exception {
    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
    StepState step2 = new StepState(new StubStep("step2"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.FAILED.getExitCode(), "end0"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.COMPLETED.getExitCode(), "end1"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.FAILED, "end0")));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1")));
    flow.setStateTransitions(transitions);
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  public void testFailedStep() throws Exception {
    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StateSupport("step1", FlowExecutionStatus.FAILED),
        "step2"));
    StepState step2 = new StepState(new StubStep("step2"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.FAILED.getExitCode(), "end0"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.COMPLETED.getExitCode(), "end1"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.FAILED, "end0")));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1")));
    flow.setStateTransitions(transitions);
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  @Test
  public void testFailedStepRestarted() throws Exception {
    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
    State step2State = new StateSupport("step2") {
      @Override
      public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
        JobExecution jobExecution = executor.getJobExecution();
        jobExecution.createStepExecution(getName());
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  @Test
  public void testStoppingStep() throws Exception {
    SimpleFlow flow = new SimpleFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
    State state2 = new StateSupport("step2", FlowExecutionStatus.FAILED);
    transitions.add(StateTransition.createStateTransition(state2, ExitStatus.FAILED.getExitCode(), "end0"));
    transitions.add(StateTransition.createStateTransition(state2, ExitStatus.COMPLETED.getExitCode(), "end1"));
    transitions.add(StateTransition.createStateTransition(new EndState(FlowExecutionStatus.STOPPED, "end0"),
        "step3"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1")));
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step3")), "end2"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end2")));
    flow.setStateTransitions(transitions);
    job.setFlow(flow);
    job.afterPropertiesSet();
    job.doExecute(jobExecution);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.