Tabnine Logo
Flow.start
Code IndexAdd Tabnine to your IDE (free)

How to use
start
method
in
org.springframework.batch.core.job.flow.Flow

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

origin: spring-projects/spring-batch

  @Override
  public FlowExecution call() throws Exception {
    return flow.start(executor);
  }
});
origin: spring-projects/spring-batch

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

@Test
public void testBasicHandling() throws Exception {
  Collection<Flow> flows  = new ArrayList<>();
  Flow flow1 = mock(Flow.class);
  Flow flow2 = mock(Flow.class);
  flows.add(flow1);
  flows.add(flow2);
  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);
}
origin: spring-projects/spring-batch

@Test
public void testConcurrentHandling() throws Exception {
  Flow flow1 = mock(Flow.class);
  Flow flow2 = mock(Flow.class);
  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);
}
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

/**
 * @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

/**
 * 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

@Test
public void test() throws Exception {
  FlowBuilder<Flow> builder = new FlowBuilder<>("flow");
  JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
  JobExecution execution = jobRepository.createJobExecution("foo", new JobParameters());
  builder.start(new StepSupport("step") {
    @Override
    public void execute(StepExecution stepExecution) throws JobInterruptedException,
        UnexpectedJobExecutionException {
    }
  }).end().start(new JobFlowExecutor(jobRepository, new SimpleStepHandler(jobRepository), execution));
}
origin: org.springframework.batch/spring-batch-core

  @Override
  public FlowExecution call() throws Exception {
    return flow.start(executor);
  }
});
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

  @Override
  public FlowExecution call() throws Exception {
    return flow.start(executor);
  }
});
origin: apache/servicemix-bundles

  @Override
  public FlowExecution call() throws Exception {
    return flow.start(executor);
  }
});
origin: org.springframework.batch/org.springframework.batch.core

  public FlowExecution call() throws Exception {
    return flow.start(executor);
  }
});
origin: org.springframework.batch/spring-batch-core

@Override
public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
  return flow.start(executor).getStatus();
}
origin: apache/servicemix-bundles

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

@Override
public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
  return flow.start(executor).getStatus();
}

origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

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

/**
 * @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: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

/**
 * @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: org.springframework.batch/spring-batch-core

/**
 * @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: org.springframework.batch/org.springframework.batch.core

/**
 * Delegate to the flow provided for the execution of the step.
 * 
 * @see AbstractStep#doExecute(StepExecution)
 */
@Override
protected void doExecute(StepExecution stepExecution) throws Exception {
  try {
    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);
  }
}
org.springframework.batch.core.job.flowFlowstart

Popular methods of Flow

  • getName
  • getStates
    Convenient accessor for clients needing to explore the states of this flow.

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JList (javax.swing)
  • Top plugins for Android Studio
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