public class SimpleFlow extends java.lang.Object implements Flow, org.springframework.beans.factory.InitializingBean
State
の終了ステータスに応じて条件付きでブランチになる Flow
。入力パラメーターは状態遷移です(順不同)。開始状態の名前は、明示的に指定することができ(遷移のセットに存在する必要があります)、あいまいでない場合は既存の遷移から計算できます。コンストラクターと説明 |
---|
SimpleFlow(java.lang.String name) 指定された名前でフローを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
void | afterPropertiesSet() 開始状態を特定し、実行に必要なデータ構造を事前に入力します。 |
java.lang.String | getName() このフローの名前を取得します。 |
State | getStartState() |
State | getState(java.lang.String stateName) 指定された名前の状態を取得します。 |
protected java.util.Map<java.lang.String,State> | getStateMap() |
java.util.Collection<State> | getStates() このフローの状態を調査する必要があるクライアントのための便利なアクセサー。 |
protected java.util.Map<java.lang.String,java.util.Set<StateTransition>> | getTransitionMap() |
protected boolean | isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution) |
protected State | nextState(java.lang.String stateName, FlowExecutionStatus status, StepExecution stepExecution) |
FlowExecution | resume(java.lang.String stateName, FlowExecutor executor) |
void | setStateTransitionComparator(java.util.Comparator<StateTransition> stateTransitionComparator) |
void | setStateTransitions(java.util.List<StateTransition> stateTransitions) stateTransitions のパブリック setter。 |
FlowExecution | start(FlowExecutor executor) |
public SimpleFlow(java.lang.String name)
name
- フローの名前 public void setStateTransitionComparator(java.util.Comparator<StateTransition> stateTransitionComparator)
public State getStartState()
public java.lang.String getName()
Flow
の getName
Flow.getName()
public void setStateTransitions(java.util.List<StateTransition> stateTransitions)
stateTransitions
- 設定する stateTransitionspublic State getState(java.lang.String stateName)
public java.util.Collection<State> getStates()
public void afterPropertiesSet() throws java.lang.Exception
org.springframework.beans.factory.InitializingBean
の afterPropertiesSet
java.lang.Exception
InitializingBean.afterPropertiesSet()
public FlowExecution start(FlowExecutor executor) throws FlowExecutionException
Flow
の start
executor
- フローの実行に使用する FlowExecutor
インスタンス。FlowExecution
。FlowExecutionException
- フローの実行中にエラーが発生した場合にスローされます。Flow.start(FlowExecutor)
public FlowExecution resume(java.lang.String stateName, FlowExecutor executor) throws FlowExecutionException
Flow
の resume
stateName
- 再開する状態の名前。executor
- 実行される各状態に渡されるコンテキスト。FlowExecution
。FlowExecutionException
- フローの実行中にエラーが発生した場合にスローされます。Flow.resume(String, FlowExecutor)
protected java.util.Map<java.lang.String,java.util.Set<StateTransition>> getTransitionMap()
protected java.util.Map<java.lang.String,State> getStateMap()
protected State nextState(java.lang.String stateName, FlowExecutionStatus status, StepExecution stepExecution) throws FlowExecutionException
stateName
- 次の状態の名前。status
- FlowExecutionStatus
インスタンス。stepExecution
- StepExecution
インスタンス。Step
(これで終わりの場合は null)FlowExecutionException
- nextState 処理中にエラーが発生した場合にスローされます。protected boolean isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution)