Enum WorkflowStateType
- java.lang.Object
-
- java.lang.Enum<WorkflowStateType>
-
- io.nflow.engine.workflow.definition.WorkflowStateType
-
- All Implemented Interfaces:
Serializable,Comparable<WorkflowStateType>
public enum WorkflowStateType extends Enum<WorkflowStateType>
Workflow state types.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description endFinal state of the workflow.manualState that requires manual action.normalState that can be normally executed.startInitial states of the workflow.waitState for waiting something outside this instance to happen, including (but not limited to) child workflow instances to go to end state.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowInstance.WorkflowInstanceStatusgetStatus(org.joda.time.DateTime nextActivation)Returns the status for this type.booleanisFinal()Returns true is the state of this type is a final state, e.g.static WorkflowStateTypevalueOf(String name)Returns the enum constant of this type with the specified name.static WorkflowStateType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
start
public static final WorkflowStateType start
Initial states of the workflow.
-
manual
public static final WorkflowStateType manual
State that requires manual action. Workflow execution is stopped.
-
normal
public static final WorkflowStateType normal
State that can be normally executed.
-
wait
public static final WorkflowStateType wait
State for waiting something outside this instance to happen, including (but not limited to) child workflow instances to go to end state. When a child workflow finishes and parent is in wait state, parent is automatically woken up.
-
end
public static final WorkflowStateType end
Final state of the workflow. Workflow execution is stopped.
-
-
Method Detail
-
values
public static WorkflowStateType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WorkflowStateType c : WorkflowStateType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WorkflowStateType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
isFinal
public boolean isFinal()
Returns true is the state of this type is a final state, e.g. a state after which the workflow processing is stopped. The workflow state can be moved to another state only by manual action.- Returns:
- True for states of type
manualandend, false for states of typestartandnormal.
-
getStatus
public WorkflowInstance.WorkflowInstanceStatus getStatus(org.joda.time.DateTime nextActivation)
Returns the status for this type. This is used when a workflow instance state is updated, the new status of the instance will be determined based on the new state type and next activation time.- Parameters:
nextActivation- The next activation for the instance.- Returns:
- The status resolved for this state type and nextActivation.
-
-