Tabnine Logo
FlowStep.setFlow
Code IndexAdd Tabnine to your IDE (free)

How to use
setFlow
method
in
org.springframework.batch.core.job.flow.FlowStep

Best Java code snippets using org.springframework.batch.core.job.flow.FlowStep.setFlow (Showing top 8 results out of 315)

origin: spring-projects/spring-batch

/**
 * Build a step that executes the flow provided, normally composed of other steps. The flow is not executed in a
 * transaction because the individual steps are supposed to manage their own transaction state.
 * 
 * @return a flow step
 */
public Step build() {
  FlowStep step = new FlowStep();
  step.setName(getName());
  step.setFlow(flow);
  super.enhance(step);
  try {
    step.afterPropertiesSet();
  }
  catch (Exception e) {
    throw new StepBuilderException(e);
  }
  return step;
}
origin: spring-projects/spring-batch

/**
 * Test method for {@link org.springframework.batch.core.job.flow.FlowStep#doExecute(org.springframework.batch.core.StepExecution)}.
 */
@Test
public void testDoExecute() throws Exception {
  FlowStep step = new FlowStep();
  step.setJobRepository(jobRepository);
  SimpleFlow flow = new SimpleFlow("job");
  List<StateTransition> transitions = new ArrayList<>();
  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);
  step.setFlow(flow);
  step.afterPropertiesSet();
  StepExecution stepExecution = jobExecution.createStepExecution("step");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  stepExecution = getStepExecution(jobExecution, "step");
  assertEquals(ExitStatus.COMPLETED, stepExecution.getExitStatus());
  stepExecution = getStepExecution(jobExecution, "step2");
  assertEquals(ExitStatus.COMPLETED, stepExecution.getExitStatus());
  assertEquals(3, jobExecution.getStepExecutions().size());
}
origin: spring-projects/spring-batch

@Test
public void testDoExecuteAndFail() throws Exception {
  FlowStep step = new FlowStep();
  step.setJobRepository(jobRepository);
  SimpleFlow flow = new SimpleFlow("job");
  List<StateTransition> transitions = new ArrayList<>();
  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);
  step.setFlow(flow);
  step.afterPropertiesSet();
  StepExecution stepExecution = jobExecution.createStepExecution("step");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  stepExecution = getStepExecution(jobExecution, "step1");
  assertEquals(ExitStatus.COMPLETED, stepExecution.getExitStatus());
  stepExecution = getStepExecution(jobExecution, "step2");
  assertEquals(ExitStatus.FAILED, stepExecution.getExitStatus());
  stepExecution = getStepExecution(jobExecution, "step");
  assertEquals(ExitStatus.FAILED, stepExecution.getExitStatus());
  assertEquals(3, jobExecution.getStepExecutions().size());
}
origin: spring-projects/spring-batch

/**
 * Test method for {@link org.springframework.batch.core.job.flow.FlowStep#doExecute(org.springframework.batch.core.StepExecution)}.
 */
@Test
public void testExecuteWithParentContext() throws Exception {
  FlowStep step = new FlowStep();
  step.setJobRepository(jobRepository);
  SimpleFlow flow = new SimpleFlow("job");
  List<StateTransition> transitions = new ArrayList<>();
  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();
  StepExecution stepExecution = jobExecution.createStepExecution("step");
  stepExecution.getExecutionContext().put("foo", "bar");
  jobRepository.add(stepExecution);
  step.execute(stepExecution);
  stepExecution = getStepExecution(jobExecution, "step");
  assertEquals(ExitStatus.COMPLETED, stepExecution.getExitStatus());
  stepExecution = getStepExecution(jobExecution, "step1");
  assertEquals(ExitStatus.COMPLETED, stepExecution.getExitStatus());
  assertEquals("bar", stepExecution.getExecutionContext().get("foo"));
}
origin: org.springframework.batch/org.springframework.batch.core

@SuppressWarnings("serial")
private void configureFlowStep(FlowStep ts) {
  configureAbstractStep(ts);
  if (flow != null) {
    ts.setFlow(flow);
  }
}
origin: org.springframework.batch/spring-batch-core

/**
 * Build a step that executes the flow provided, normally composed of other steps. The flow is not executed in a
 * transaction because the individual steps are supposed to manage their own transaction state.
 * 
 * @return a flow step
 */
public Step build() {
  FlowStep step = new FlowStep();
  step.setName(getName());
  step.setFlow(flow);
  super.enhance(step);
  try {
    step.afterPropertiesSet();
  }
  catch (Exception e) {
    throw new StepBuilderException(e);
  }
  return step;
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

/**
 * Build a step that executes the flow provided, normally composed of other steps. The flow is not executed in a
 * transaction because the individual steps are supposed to manage their own transaction state.
 * 
 * @return a flow step
 */
public Step build() {
  FlowStep step = new FlowStep();
  step.setName(getName());
  step.setFlow(flow);
  super.enhance(step);
  try {
    step.afterPropertiesSet();
  }
  catch (Exception e) {
    throw new StepBuilderException(e);
  }
  return step;
}
origin: apache/servicemix-bundles

/**
 * Build a step that executes the flow provided, normally composed of other steps. The flow is not executed in a
 * transaction because the individual steps are supposed to manage their own transaction state.
 * 
 * @return a flow step
 */
public Step build() {
  FlowStep step = new FlowStep();
  step.setName(getName());
  step.setFlow(flow);
  super.enhance(step);
  try {
    step.afterPropertiesSet();
  }
  catch (Exception e) {
    throw new StepBuilderException(e);
  }
  return step;
}
org.springframework.batch.core.job.flowFlowStepsetFlow

Javadoc

Public setter for the flow.

Popular methods of FlowStep

  • <init>
    Constructor for a FlowStep that sets the flow and of the step explicitly.
  • afterPropertiesSet
    Ensure that the flow is set.
  • getJobRepository
  • getName
  • setName
  • execute
  • setJobRepository

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • CodeWhisperer alternatives
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