Interface FlowExecutor
- All Known Implementing Classes:
JobFlowExecutor
public interface FlowExecutor
Context and execution strategy for
FlowJob
to allow it to delegate its
execution step by step.- Since:
- 2.0
- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Handle any status changes that might be needed at the start of a state.void
addExitStatus
(String code) void
close
(FlowExecution result) Chance to clean up resources at the end of a flow (whether it completed successfully or not).executeStep
(Step step) boolean
void
Handle any status changes that might be needed in theJobExecution
.
-
Method Details
-
executeStep
String executeStep(Step step) throws JobInterruptedException, JobRestartException, StartLimitExceededException - Parameters:
step
- aStep
to execute- Returns:
- the exit status that drives the surrounding
Flow
- Throws:
StartLimitExceededException
- thrown if start limit is exceeded.JobRestartException
- thrown if job restart is not allowed.JobInterruptedException
- thrown if job was interrupted.
-
getJobExecution
JobExecution getJobExecution()- Returns:
- the current
JobExecution
-
getStepExecution
- Returns:
- the latest
StepExecution
or null if there is none
-
close
Chance to clean up resources at the end of a flow (whether it completed successfully or not).- Parameters:
result
- the finalFlowExecution
-
abandonStepExecution
void abandonStepExecution()Handle any status changes that might be needed at the start of a state. -
updateJobExecutionStatus
Handle any status changes that might be needed in theJobExecution
.- Parameters:
status
- status to update theJobExecution
to.
-
isRestart
boolean isRestart()- Returns:
- true if the flow is at the beginning of a restart
-
addExitStatus
- Parameters:
code
- the label for the exit status when a flow or sub-flow ends
-