Class JsrFlow
- java.lang.Object
- org.springframework.batch.core.job.flow.support.SimpleFlow
- org.springframework.batch.core.jsr.job.flow.support.JsrFlow
- All Implemented Interfaces:
Flow
,org.springframework.beans.factory.InitializingBean
public class JsrFlow extends SimpleFlow
Implements JSR-352 specific logic around the execution of a flow. Specifically, thisFlow
implementation will attempt to find the next state based on the provided exit status. If none is found (the exit status isn't mapped), it will attempt to resolve the next state basing it on the last step's batch status. Only if both attempts fail, the flow will fail due to the inability to find the next state.- Since:
- 3.0
- Author:
- Michael Minella, Mahmoud Ben Hassine
Constructor Summary
Constructors Constructor Description JsrFlow(java.lang.String name)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getMostRecentStepName()
protected boolean
isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution)
protected State
nextState(java.lang.String stateName, FlowExecutionStatus status, StepExecution stepExecution)
Methods inherited from class org.springframework.batch.core.job.flow.support.SimpleFlow
afterPropertiesSet, getName, getStartState, getState, getStateMap, getStates, getTransitionMap, resume, setStateTransitionComparator, setStateTransitions, start
Method Detail
getMostRecentStepName
@Nullable public java.lang.String getMostRecentStepName()
isFlowContinued
protected boolean isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution)
- Overrides:
isFlowContinued
in classSimpleFlow
nextState
protected State nextState(java.lang.String stateName, FlowExecutionStatus status, StepExecution stepExecution) throws FlowExecutionException
- Overrides:
nextState
in classSimpleFlow
- Parameters:
stateName
- the name of the next state.status
-FlowExecutionStatus
instance.stepExecution
-StepExecution
instance.- Returns:
- the next
Step
(or null if this is the end) - Throws:
FlowExecutionException
- thrown if error occurs during nextState processing.