Package org.springframework.batch.core.job.flow

Examples of org.springframework.batch.core.job.flow.FlowExecutionStatus


   * @see Flow#resume(String, FlowExecutor)
   */
  @Override
  public FlowExecution resume(String stateName, FlowExecutor executor) throws FlowExecutionException {

    FlowExecutionStatus status = FlowExecutionStatus.UNKNOWN;
    State state = stateMap.get(stateName);

    logger.debug("Resuming state="+stateName+" with status="+status);
    StepExecution stepExecution = null;

View Full Code Here


    /*
     * On starting a new step, possibly upgrade the last execution to make
     * sure it is abandoned on restart if it failed.
     */
    executor.abandonStepExecution();
    return new FlowExecutionStatus(executor.executeStep(step));
  }
View Full Code Here

    int count = 0;
    @Override
    public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution) {
      if (count++<2) {
        return new FlowExecutionStatus("OK");
      }
      return new FlowExecutionStatus("END");
    }
View Full Code Here

    public FlowExecutionStatus decide(JobExecution jobExecution,
        StepExecution stepExecution) {
      count++;

      if(count > 2) {
        return new FlowExecutionStatus("END");
      }
      else {
        return new FlowExecutionStatus("CONTINUE");
      }
    }
View Full Code Here

    StepExecution stepExecution = new StepExecution("step1", new JobExecution(5L));
    stepExecution.setExitStatus(new ExitStatus("unmapped exit code"));
    stepExecution.setStatus(BatchStatus.FAILED);
    executor = new FlowExecutor(stepExecution);

    State startState = new StateSupport("step1", new FlowExecutionStatus("unmapped exit code"));
    State endState = new StateSupport("failed", FlowExecutionStatus.FAILED);

    StateTransition failureTransition = StateTransition.createStateTransition(startState, "FAILED", "failed");
    StateTransition endTransition = StateTransition.createEndStateTransition(endState);
    flow.setStateTransitions(collect(failureTransition, endTransition));
View Full Code Here

    JobExecutionDecider decider = new JobExecutionDecider() {
      private int count = 0;
      @Override
      public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution) {
        count++;
        return count<2 ? new FlowExecutionStatus("ONGOING") : FlowExecutionStatus.COMPLETED;
      }
    };
    step1.setAllowStartIfComplete(true);
    SimpleJobBuilder builder = new JobBuilder("flow").repository(jobRepository).start(step1);
    builder.next(decider).on("COMPLETED").end().from(decider).on("*").to(step1).end();
 
View Full Code Here

    SplitState state = new SplitState(flows, "foo");

    when(flow1.start(executor)).thenReturn(new FlowExecution("step1", FlowExecutionStatus.COMPLETED));
    when(flow2.start(executor)).thenReturn(new FlowExecution("step1", FlowExecutionStatus.COMPLETED));

    FlowExecutionStatus result = state.handle(executor);
    assertEquals(FlowExecutionStatus.COMPLETED, result);

  }
View Full Code Here

    SplitState state = new SplitState(Arrays.asList(flow1, flow2), "foo");
    state.setTaskExecutor(new SimpleAsyncTaskExecutor());

    when(flow1.start(executor)).thenReturn(new FlowExecution("step1", FlowExecutionStatus.COMPLETED));
    when(flow2.start(executor)).thenReturn(new FlowExecution("step1", FlowExecutionStatus.COMPLETED));
    FlowExecutionStatus result = state.handle(executor);
    assertEquals(FlowExecutionStatus.COMPLETED, result);

  }
View Full Code Here

  public void testHandleOngoingSunnyDay() throws Exception {

    jobExecution.createStepExecution("foo");
 
    EndState state = new EndState(FlowExecutionStatus.UNKNOWN, "end");
    FlowExecutionStatus status = state.handle(new JobFlowExecutorSupport() {
      @Override
      public JobExecution getJobExecution() {
        return jobExecution;
      }
    });
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.job.flow.FlowExecutionStatus

Copyright © 2018 www.massapicom. 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.