Class FlowBuilder<Q>
java.lang.Object
org.springframework.batch.core.job.builder.FlowBuilder<Q>
- Type Parameters:
Q
- the type of object returned by the builder (by default a Flow)
- Direct Known Subclasses:
JobFlowBuilder
A builder for a flow of steps that can be executed as a job or as part of a job. Steps
can be linked together with conditional transitions that depend on the exit status of
the previous step.
- Since:
- 2.2
- Author:
- Dave Syer, Michael Minella
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder for building a split state.static class
A builder for transitions within a flow.static class
A builder for continuing a flow from a decision state. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Validate the current state of the builder and build a flow.final Q
end()
A synonym forbuild()
which callers might find useful.protected Flow
flow()
Start again from a subflow that was already registered.from
(JobExecutionDecider decider) Start again from a decision that was already registered.Go back to a previously registered step and start a new path.Go next on successful completion to a subflow.next
(JobExecutionDecider decider) Transition to the decider on successful completion of the current step.Transition to the next step on successful completion of the current step.Start a transition to a new state if the exit status from the previous state matches the pattern given.split
(org.springframework.core.task.TaskExecutor executor) If a flow should start with a subflow use this as the first state.start
(JobExecutionDecider decider) If a flow should start with a decision use this as the first state.Start a flow.protected void
protected void
-
Constructor Details
-
FlowBuilder
-
-
Method Details
-
build
Validate the current state of the builder and build a flow. Subclasses may override this to build an object of a different type that itself depends on the flow.- Returns:
- a flow
-
next
Transition to the next step on successful completion of the current step. All other outcomes are treated as failures.- Parameters:
step
- the next step- Returns:
- this to enable chaining
-
start
Start a flow. If some steps are already registered, just a synonym forfrom(Step)
.- Parameters:
step
- the step to start with- Returns:
- this to enable chaining
-
from
Go back to a previously registered step and start a new path. If no steps are registered yet just a synonym forstart(Step)
.- Parameters:
step
- the step to start from (already registered)- Returns:
- this to enable chaining
-
next
Transition to the decider on successful completion of the current step. All other outcomes are treated as failures.- Parameters:
decider
- the JobExecutionDecider to determine the next step to execute- Returns:
- this to enable chaining
-
start
If a flow should start with a decision use this as the first state.- Parameters:
decider
- the to start from- Returns:
- a builder to enable chaining
-
from
Start again from a decision that was already registered.- Parameters:
decider
- the decider to start from (already registered)- Returns:
- a builder to enable chaining
-
next
Go next on successful completion to a subflow.- Parameters:
flow
- the flow to go to- Returns:
- a builder to enable chaining
-
from
Start again from a subflow that was already registered.- Parameters:
flow
- the flow to start from (already registered)- Returns:
- a builder to enable chaining
-
start
If a flow should start with a subflow use this as the first state.- Parameters:
flow
- the flow to start from- Returns:
- a builder to enable chaining
-
split
- Parameters:
executor
- a task executor to execute the split flows- Returns:
- a builder to enable fluent chaining
-
on
Start a transition to a new state if the exit status from the previous state matches the pattern given. Successful completion normally results in an exit status equal to (or starting with by convention) "COMPLETED". SeeExitStatus
for commonly used values.- Parameters:
pattern
- the pattern of exit status on which to take this transition- Returns:
- a builder to enable fluent chaining
-
end
A synonym forbuild()
which callers might find useful. Subclasses can override build to create an object of the desired type (e.g. a parent builder or an actual flow).- Returns:
- the result of the builder
-
flow
-
stop
-
stop
-