类 FlowBuilder<Q>
- java.lang.Object
- org.springframework.batch.core.job.builder.FlowBuilder<Q>
- 类型参数:
Q
- the type of object returned by the builder (by default a Flow)
- 直接已知子类:
JobFlowBuilder
public class FlowBuilder<Q> extends java.lang.Object
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.- 从以下版本开始:
- 2.2
- 作者:
- Dave Syer, Michael Minella
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
FlowBuilder.SplitBuilder<Q>
A builder for building a split state.static class
FlowBuilder.TransitionBuilder<Q>
A builder for transitions within a flow.static class
FlowBuilder.UnterminatedFlowBuilder<Q>
A builder for continuing a flow from a decision state.
构造器概要
构造器 构造器 说明 FlowBuilder(java.lang.String name)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Q
build()
Validate the current state of the builder and build a flow.Q
end()
A synonym forbuild()
which callers might find useful.protected Flow
flow()
FlowBuilder<Q>
from(Flow flow)
Start again from a subflow that was already registered.FlowBuilder.UnterminatedFlowBuilder<Q>
from(JobExecutionDecider decider)
Start again from a decision that was already registered.FlowBuilder<Q>
from(Step step)
Go back to a previously registered step and start a new path.FlowBuilder<Q>
next(Flow flow)
Go next on successful completion to a subflow.FlowBuilder.UnterminatedFlowBuilder<Q>
next(JobExecutionDecider decider)
Transition to the decider on successful completion of the current step.FlowBuilder<Q>
next(Step step)
Transition to the next step on successful completion of the current step.FlowBuilder.TransitionBuilder<Q>
on(java.lang.String pattern)
Start a transition to a new state if the exit status from the previous state matches the pattern given.FlowBuilder.SplitBuilder<Q>
split(org.springframework.core.task.TaskExecutor executor)
FlowBuilder<Q>
start(Flow flow)
If a flow should start with a subflow use this as the first state.FlowBuilder.UnterminatedFlowBuilder<Q>
start(JobExecutionDecider decider)
If a flow should start with a decision use this as the first state.FlowBuilder<Q>
start(Step step)
Start a flow.protected void
stop(java.lang.String pattern)
protected void
stop(java.lang.String pattern, State restart)
构造器详细资料
FlowBuilder
public FlowBuilder(java.lang.String name)
方法详细资料
build
public Q 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.- 返回:
- a flow
next
public FlowBuilder<Q> next(Step step)
Transition to the next step on successful completion of the current step. All other outcomes are treated as failures.- 参数:
step
- the next step- 返回:
- this to enable chaining
start
public FlowBuilder<Q> start(Step step)
Start a flow. If some steps are already registered, just a synonym forfrom(Step)
.- 参数:
step
- the step to start with- 返回:
- this to enable chaining
from
public FlowBuilder<Q> from(Step step)
Go back to a previously registered step and start a new path. If no steps are registered yet just a synonym forstart(Step)
.- 参数:
step
- the step to start from (already registered)- 返回:
- this to enable chaining
next
public FlowBuilder.UnterminatedFlowBuilder<Q> next(JobExecutionDecider decider)
Transition to the decider on successful completion of the current step. All other outcomes are treated as failures.- 参数:
decider
- the JobExecutionDecider to determine the next step to execute- 返回:
- this to enable chaining
start
public FlowBuilder.UnterminatedFlowBuilder<Q> start(JobExecutionDecider decider)
If a flow should start with a decision use this as the first state.- 参数:
decider
- the to start from- 返回:
- a builder to enable chaining
from
public FlowBuilder.UnterminatedFlowBuilder<Q> from(JobExecutionDecider decider)
Start again from a decision that was already registered.- 参数:
decider
- the decider to start from (already registered)- 返回:
- a builder to enable chaining
next
public FlowBuilder<Q> next(Flow flow)
Go next on successful completion to a subflow.- 参数:
flow
- the flow to go to- 返回:
- a builder to enable chaining
from
public FlowBuilder<Q> from(Flow flow)
Start again from a subflow that was already registered.- 参数:
flow
- the flow to start from (already registered)- 返回:
- a builder to enable chaining
start
public FlowBuilder<Q> start(Flow flow)
If a flow should start with a subflow use this as the first state.- 参数:
flow
- the flow to start from- 返回:
- a builder to enable chaining
split
public FlowBuilder.SplitBuilder<Q> split(org.springframework.core.task.TaskExecutor executor)
- 参数:
executor
- a task executor to execute the split flows- 返回:
- a builder to enable fluent chaining
on
public FlowBuilder.TransitionBuilder<Q> on(java.lang.String pattern)
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.- 参数:
pattern
- the pattern of exit status on which to take this transition- 返回:
- a builder to enable fluent chaining
end
public final Q 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).- 返回:
- the result of the builder
stop
protected void stop(java.lang.String pattern)