Class NextAction
java.lang.Object
io.nflow.engine.model.ModelObject
io.nflow.engine.workflow.definition.NextAction
-
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.DateTimeReturn the time after which the workflow should be activated.Return the next state of the workflow.Return the reason for the next action.booleanisRetry()Return true if this action is a retry of the current state.static NextActionmoveToState(WorkflowState nextState, String reason) Schedule processing of statenextStateimmediately.static NextActionmoveToStateAfter(WorkflowState nextState, org.joda.time.DateTime activation, String reason) Schedule processing of statenextStateat timeactivation.static NextActionretryAfter(org.joda.time.DateTime activation, String reason) Schedule retry for current state at timeactivation.static NextActionstopInState(WorkflowState finalState, String reason) Set next state tofinalStateand do not schedule its processing.Methods inherited from class io.nflow.engine.model.ModelObject
equals, hashCode, toString
-
Method Details
-
getActivation
public org.joda.time.DateTime getActivation()Return the time after which the workflow should be activated. There is no guarantee that the workflow will be activated exactly at the given time.- Returns:
- The activation time.
-
getNextState
Return the next state of the workflow.- Returns:
- The workflow state.
-
getReason
Return the reason for the next action.- Returns:
- The reason.
-
retryAfter
Schedule retry for current state at timeactivation.- Parameters:
activation- The time after which the workflow can be activated.reason- The reason for the action.- Returns:
- A valid
NextActionvalue.
-
moveToStateAfter
public static NextAction moveToStateAfter(WorkflowState nextState, org.joda.time.DateTime activation, String reason) Schedule processing of statenextStateat timeactivation.- Parameters:
nextState- The next workflow state.activation- The time after which the workflow can be activated.reason- The reason for the action.- Returns:
- A valid
NextActionvalue.
-
moveToState
Schedule processing of statenextStateimmediately.- Parameters:
nextState- The next workflow state.reason- The reason for the action.- Returns:
- A valid
NextActionvalue.
-
stopInState
Set next state tofinalStateand do not schedule its processing. ThefinalStateworkflow state type must be final, e.g. it must be either end state or manual state. The state handler method of the state, even if it exists, is not executed. Additionally, there is no workflow action recorded for thefinalState. If you want to execute the state handler method and record a workflow action, use one of themoveToStatemethods instead.- Parameters:
finalState- Final workflow state (end state or manual state).reason- The reason for the action.- Returns:
- A valid
NextActionvalue.
-
isRetry
public boolean isRetry()Return true if this action is a retry of the current state.- Returns:
- True if action is a retry, false otherwise.
-