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

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


     *
     * @param step the next step after this transition
     * @return a FlowBuilder
     */
    public FlowBuilder<Q> to(Step step) {
      State next = parent.createState(step);
      parent.addTransition(pattern, next);
      parent.currentState = next;
      return parent;
    }
View Full Code Here


     *
     * @param flow the next flow after this transition
     * @return a FlowBuilder
     */
    public FlowBuilder<Q> to(Flow flow) {
      State next = parent.createState(flow);
      parent.addTransition(pattern, next);
      parent.currentState = next;
      return parent;
    }
View Full Code Here

     *
     * @param decider the decider to determine the next step
     * @return a FlowBuilder
     */
    public FlowBuilder<Q> to(JobExecutionDecider decider) {
      State next = parent.createState(decider);
      parent.addTransition(pattern, next);
      parent.currentState = next;
      return parent;
    }
View Full Code Here

     *
     * @param flow the flow to restart with
     * @return a FlowBuilder
     */
    public FlowBuilder<Q> stopAndRestart(Flow flow) {
      State next = parent.createState(flow);
      parent.stop(pattern, next);
      return parent;
    }
View Full Code Here

     *
     * @param decider a decider to restart with
     * @return a FlowBuilder
     */
    public FlowBuilder<Q> stopAndRestart(JobExecutionDecider decider) {
      State next = parent.createState(decider);
      parent.stop(pattern, next);
      return parent;
    }
View Full Code Here

     *
     * @param restart the step to restart with
     * @return a FlowBuilder
     */
    public FlowBuilder<Q> stopAndRestart(Step restart) {
      State next = parent.createState(restart);
      parent.stop(pattern, next);
      return parent;
    }
View Full Code Here

    flow.setStateTransitionComparator(stateTransitionComparator);

    List<StateTransition> updatedTransitions = new ArrayList<StateTransition>();
    for (StateTransition stateTransition : stateTransitions) {
      State state = getProxyState(stateTransition.getState());
      updatedTransitions.add(StateTransition.switchOriginAndDestination(stateTransition, state,
          getNext(stateTransition.getNext())));
    }

    flow.setStateTransitions(updatedTransitions);
View Full Code Here

     */
    public FlowBuilder<Q> add(Flow... flows) {
      Collection<Flow> list = new ArrayList<Flow>(Arrays.asList(flows));
      String name = "split" + (parent.splitCounter++);
      int counter = 0;
      State one = parent.currentState;
      Flow flow = null;
      if (!(one instanceof FlowState)) {
        FlowBuilder<Flow> stateBuilder = new FlowBuilder<Flow>(name + "_" + (counter++));
        stateBuilder.currentState = one;
        flow = stateBuilder.build();
      }
      if (flow != null) {
        list.add(flow);
      }
      State next = parent.createState(list, executor);
      parent.currentState = next;
      return parent;
    }
View Full Code Here

    return super.isFlowContinued(state, status, stepExecution);
  }

  @Override
  protected State nextState(String stateName, FlowExecutionStatus status, StepExecution stepExecution) throws FlowExecutionException {
    State nextState = findState(stateName, status, stepExecution);

    if(stepExecution != null) {
      ExecutionContext executionContext = stepExecution.getJobExecution().getExecutionContext();
      if(executionContext.containsKey("batch.stoppedStep")) {
        String stepName = executionContext.getString("batch.stoppedStep");
View Full Code Here

  @Test
  public void testFailedStepRestarted() throws Exception {
    SimpleFlow flow = new JsrFlow("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();
        StepExecution stepExecution = jobExecution.createStepExecution(getName());
        jobRepository.add(stepExecution);
View Full Code Here

TOP

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

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.