Tabnine Logo
FlowExecution.getStatus
Code IndexAdd Tabnine to your IDE (free)

How to use
getStatus
method
in
org.springframework.batch.core.job.flow.FlowExecution

Best Java code snippets using org.springframework.batch.core.job.flow.FlowExecution.getStatus (Showing top 20 results out of 315)

origin: spring-projects/spring-batch

/**
 * Aggregate all of the {@link FlowExecutionStatus}es of the
 * {@link FlowExecution}s into one status. The aggregate status will be the
 * status with the highest precedence.
 *
 * @see FlowExecutionAggregator#aggregate(Collection)
 */
@Override
public FlowExecutionStatus aggregate(Collection<FlowExecution> executions) {
  if (executions == null || executions.size() == 0) {
    return FlowExecutionStatus.UNKNOWN;
  }
  return Collections.max(executions).getStatus();
}
origin: spring-projects/spring-batch

@Override
public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
  return flow.start(executor).getStatus();
}
origin: spring-projects/spring-batch

/**
 * Create an ordering on {@link FlowExecution} instances by comparing their
 * statuses.
 *
 * @see Comparable#compareTo(Object)
 *
 * @param other the {@link FlowExecution} instance to compare with this instance.
 * @return negative, zero or positive as per the contract
 */
@Override
public int compareTo(FlowExecution other) {
  return this.status.compareTo(other.getStatus());
}
origin: spring-projects/spring-batch

/**
 * @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);
  }
}
origin: spring-projects/spring-batch

@Test
public void testOneStepWithListenerCallsClose() throws Exception {
  flow.setStateTransitions(Collections.singletonList(StateTransition.createEndStateTransition(new StubState(
      "step1"))));
  flow.afterPropertiesSet();
  final List<FlowExecution> list = new ArrayList<>();
  executor = new JobFlowExecutorSupport() {
    @Override
    public void close(FlowExecution result) {
      list.add(result);
    }
  };
  FlowExecution execution = flow.start(executor);
  assertEquals(1, list.size());
  assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
  assertEquals("step1", execution.getName());
}
origin: spring-projects/spring-batch

@Test
public void testOneStep() throws Exception {
  flow.setStateTransitions(Collections.singletonList(StateTransition.createEndStateTransition(new StubState(
      "step1"))));
  flow.afterPropertiesSet();
  FlowExecution execution = flow.start(executor);
  assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
  assertEquals("step1", execution.getName());
}
origin: spring-projects/spring-batch

/**
 * 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);
  }
}
origin: spring-projects/spring-batch

/**
 * @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);
  }
}
origin: spring-projects/spring-batch

@Test
public void testBasicProperties() throws Exception {
  FlowExecution execution = new FlowExecution("foo", new FlowExecutionStatus("BAR"));
  assertEquals("foo",execution.getName());
  assertEquals("BAR",execution.getStatus().getName());
}
origin: spring-projects/spring-batch

@Test
public void testResume() throws Exception {
  flow.setStateTransitions(collect(StateTransition.createStateTransition(new StubState("step1"), "step2"),
      StateTransition.createEndStateTransition(new StubState("step2"))));
  flow.afterPropertiesSet();
  FlowExecution execution = flow.resume("step2", executor);
  assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
  assertEquals("step2", execution.getName());
}
origin: spring-projects/spring-batch

@Test
public void testUnconnectedSteps() throws Exception {
  flow.setStateTransitions(collect(StateTransition.createEndStateTransition(new StubState("step1")),
      StateTransition.createEndStateTransition(new StubState("step2"))));
  flow.afterPropertiesSet();
  FlowExecution execution = flow.start(executor);
  assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
  assertEquals("step1", execution.getName());
}
origin: spring-projects/spring-batch

@Test
public void testStepLoop() throws Exception {
  flow.setStateTransitions(collect(StateTransition.createStateTransition(new StateSupport("step"),
      ExitStatus.FAILED.getExitCode(), "step"), StateTransition.createEndStateTransition(new StateSupport("step"))));
  flow.afterPropertiesSet();
  FlowExecution execution = flow.start(executor);
  assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
  assertEquals("step", execution.getName());
}
origin: spring-projects/spring-batch

@Test
public void testTwoSteps() throws Exception {
  flow.setStateTransitions(collect(StateTransition.createStateTransition(new StubState("step1"), "step2"),
      StateTransition.createEndStateTransition(new StubState("step2"))));
  flow.afterPropertiesSet();
  FlowExecution execution = flow.start(executor);
  assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
  assertEquals("step2", execution.getName());
}
origin: spring-projects/spring-batch

@Test
public void testFailedStep() throws Exception {
  flow.setStateTransitions(collect(StateTransition.createStateTransition(new StubState("step1") {
    @Override
    public FlowExecutionStatus handle(FlowExecutor executor) {
      return FlowExecutionStatus.FAILED;
    }
  }, "step2"), StateTransition.createEndStateTransition(new StubState("step2"))));
  flow.afterPropertiesSet();
  FlowExecution execution = flow.start(executor);
  assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
  assertEquals("step2", execution.getName());
}
origin: spring-projects/spring-batch

@Test
public void testExplicitStartStep() throws Exception {
  flow.setStateTransitions(collect(StateTransition.createStateTransition(new StubState("step"),
      ExitStatus.FAILED.getExitCode(), "step"), StateTransition.createEndStateTransition(new StubState("step"))));
  flow.afterPropertiesSet();
  FlowExecution execution = flow.start(executor);
  assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
  assertEquals("step", execution.getName());
}
origin: spring-projects/spring-batch

@Test
public void testBranching() throws Exception {
  flow.setStateTransitions(collect(StateTransition.createStateTransition(new StubState("step1"), "step2"),
      StateTransition.createStateTransition(new StubState("step1"), ExitStatus.COMPLETED.getExitCode(), "step3"),
      StateTransition.createEndStateTransition(new StubState("step2")), StateTransition
      .createEndStateTransition(new StubState("step3"))));
  flow.setStateTransitionComparator(new DefaultStateTransitionComparator());
  flow.afterPropertiesSet();
  FlowExecution execution = flow.start(executor);
  assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
  assertEquals("step3", execution.getName());
}
origin: spring-projects/spring-batch

@Test
public void testNextBasedOnBatchStatus() throws Exception {
  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));
  flow.afterPropertiesSet();
  FlowExecution execution = flow.start(executor);
  assertEquals(FlowExecutionStatus.FAILED, execution.getStatus());
  assertEquals("failed", execution.getName());
}
origin: org.springframework.batch/spring-batch-core

@Override
public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
  return flow.start(executor).getStatus();
}
origin: org.springframework.batch/org.springframework.batch.core

/**
 * Create an ordering on {@link FlowExecution} instances by comparing their
 * statuses.
 * 
 * @see Comparable#compareTo(Object)
 * 
 * @param other
 * @return negative, zero or positive as per the contract
 */
public int compareTo(FlowExecution other) {
  return this.status.compareTo(other.getStatus());
}
origin: org.springframework.batch/spring-batch-core

/**
 * Create an ordering on {@link FlowExecution} instances by comparing their
 * statuses.
 *
 * @see Comparable#compareTo(Object)
 *
 * @param other the {@link FlowExecution} instance to compare with this instance.
 * @return negative, zero or positive as per the contract
 */
@Override
public int compareTo(FlowExecution other) {
  return this.status.compareTo(other.getStatus());
}
org.springframework.batch.core.job.flowFlowExecutiongetStatus

Popular methods of FlowExecution

  • <init>
  • compareTo
    Create an ordering on FlowExecution instances by comparing their statuses.
  • getName

Popular in Java

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
  • Menu (java.awt)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JButton (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now