public class SimpleFlow extends Object implements Flow, org.springframework.beans.factory.InitializingBean
Flow
that branches conditionally depending on the exit status of
the last State
. The input parameters are the state transitions (in no
particular order). The start state name can be specified explicitly (and must
exist in the set of transitions), or computed from the existing transitions,
if unambiguous.Constructor and Description |
---|
SimpleFlow(String name)
Create a flow with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Locate start state and pre-populate data structures needed for execution.
|
String |
getName()
Get the name for this flow.
|
State |
getState(String stateName)
Retrieve the State with the given name.
|
Collection<State> |
getStates()
Convenient accessor for clients needing to explore the states of this
flow.
|
FlowExecution |
resume(String stateName,
FlowExecutor executor) |
void |
setStateTransitions(List<StateTransition> stateTransitions)
Public setter for the stateTransitions.
|
FlowExecution |
start(FlowExecutor executor) |
public SimpleFlow(String name)
name
- the name of the flowpublic String getName()
getName
in interface Flow
Flow.getName()
public void setStateTransitions(List<StateTransition> stateTransitions)
stateTransitions
- the stateTransitions to setpublic State getState(String stateName)
public Collection<State> getStates()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
InitializingBean.afterPropertiesSet()
public FlowExecution start(FlowExecutor executor) throws FlowExecutionException
start
in interface Flow
FlowExecutionException
Flow.start(FlowExecutor)
public FlowExecution resume(String stateName, FlowExecutor executor) throws FlowExecutionException
resume
in interface Flow
stateName
- the name of the state to resume onexecutor
- the context to be passed into each state executedFlowExecution
containing the exit status of the flowFlowExecutionException
Flow.resume(String, FlowExecutor)
Copyright © 2014 Pivotal. All rights reserved.