Package fr.gouv.vitam.common.model
Enum ProcessState
- java.lang.Object
-
- java.lang.Enum<ProcessState>
-
- fr.gouv.vitam.common.model.ProcessState
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ProcessState>
public enum ProcessState extends java.lang.Enum<ProcessState>
The different states of the ProcessWorkflow For each state (PAUSE, RUNNING, COMPLETED) we can send an number of events.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description COMPLETED
Represent the current completed state Throws StateNotAllowedException for allPAUSE
Represent the current pause state Accept all Pause => do nothing Resume => change the state to running then run all steps at the end change step to completed Next => Change the state to running then run the next step only.RUNNING
Represent the current running state Accept Pause and cancel Pause => continue execution of current step (only for step by step) then change state to : - pause if not last step - completed Cancel => continue execution of current process (step or all steps) then change state to complete Throws StateNotAllowedException for other
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
eval(ProcessState targetState)
Evaluate for the current state if the given state is permitted or notjavax.ws.rs.core.Response.Status
getEquivalentHttpStatus()
get equivalent http statusstatic ProcessState
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ProcessState[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PAUSE
public static final ProcessState PAUSE
Represent the current pause state Accept all Pause => do nothing Resume => change the state to running then run all steps at the end change step to completed Next => Change the state to running then run the next step only. If the last step then change the state to completed else change the state to pause Cancel => Change the state to completed
-
RUNNING
public static final ProcessState RUNNING
Represent the current running state Accept Pause and cancel Pause => continue execution of current step (only for step by step) then change state to : - pause if not last step - completed Cancel => continue execution of current process (step or all steps) then change state to complete Throws StateNotAllowedException for other
-
COMPLETED
public static final ProcessState COMPLETED
Represent the current completed state Throws StateNotAllowedException for all
-
-
Method Detail
-
values
public static ProcessState[] 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 (ProcessState c : ProcessState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ProcessState valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
eval
public void eval(ProcessState targetState) throws StateNotAllowedException
Evaluate for the current state if the given state is permitted or not- Throws:
StateNotAllowedException
-
getEquivalentHttpStatus
public javax.ws.rs.core.Response.Status getEquivalentHttpStatus()
get equivalent http status- Returns:
- the status
-
-