Class InvalidInstanceStateException
java.lang.Object
java.lang.Throwable
java.lang.Exception
de.aristaflow.adept2.model.processmodel.InvalidInstanceStateException
- All Implemented Interfaces:
Serializable
This exception will be raised if a process instance is not in the right state
to perform a desired action. This can be either due to the current execution
state of the instance or the current migration state.
- Author:
- Ulrich Kreher, Markus Lauer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ProcessConstants.InstanceExecutionStatusThe execution state in which the instance currently is and which prevents the execution of the called method.protected final UUIDThe ID of the instance which is in the wrong state for the desired action.protected final booleanWhether the current migration state prevents the action (or the current execution state).protected final ProcessConstants.InstanceMigrationStatusThe migration state in which the instance currently is and which prevents the desired action. -
Constructor Summary
ConstructorsConstructorDescriptionInvalidInstanceStateException(UUID instanceID, ProcessConstants.InstanceExecutionStatus currentExecutionState, ProcessConstants.InstanceMigrationStatus currentMigrationState, boolean migrationPrevents, String message) Constructs a newInvalidInstanceStateExceptionwhich signals that the designated instance is in the designated execution and migration state and one of them prevents the desired action.InvalidInstanceStateException(UUID instanceID, ProcessConstants.InstanceExecutionStatus currentExecutionState, String message) Constructs a newInvalidInstanceStateExceptionwhich signals that the designated instance is in the designated current execution state which prevents the desired action.InvalidInstanceStateException(UUID instanceID, ProcessConstants.InstanceMigrationStatus currentMigrationState, String message) Constructs a newInvalidInstanceStateExceptionwhich signals that the designated instance is in the designated current migration state which prevents the desired action. -
Method Summary
Modifier and TypeMethodDescriptionGets the execution status of the instance which has led to this exception or null in case a migration state has led to this exception.Gets the execution status of the instance which has led to this exception or null in case a migration state has led to this exception.Gets the migration status of the instance which has led to this exception or null in case an execution state has led to this exception.Gets the string representation of the state which prevents the desired action and which has led to this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
instanceID
The ID of the instance which is in the wrong state for the desired action. -
executionState
The execution state in which the instance currently is and which prevents the execution of the called method. -
migrationState
The migration state in which the instance currently is and which prevents the desired action. -
migrationPrevents
protected final boolean migrationPreventsWhether the current migration state prevents the action (or the current execution state).
-
-
Constructor Details
-
InvalidInstanceStateException
public InvalidInstanceStateException(UUID instanceID, ProcessConstants.InstanceExecutionStatus currentExecutionState, String message) Constructs a newInvalidInstanceStateExceptionwhich signals that the designated instance is in the designated current execution state which prevents the desired action.- Parameters:
instanceID- The ID of the instance which is in the wrong execution state for the desired action.currentExecutionState- The current execution state of the instance.message- A message to display to the user.
-
InvalidInstanceStateException
public InvalidInstanceStateException(UUID instanceID, ProcessConstants.InstanceMigrationStatus currentMigrationState, String message) Constructs a newInvalidInstanceStateExceptionwhich signals that the designated instance is in the designated current migration state which prevents the desired action.- Parameters:
instanceID- The ID of the instance which is in the wrong migration state for the desired action.currentMigrationState- The current migration state of the instance.message- A message to display to the user.
-
InvalidInstanceStateException
public InvalidInstanceStateException(UUID instanceID, ProcessConstants.InstanceExecutionStatus currentExecutionState, ProcessConstants.InstanceMigrationStatus currentMigrationState, boolean migrationPrevents, String message) Constructs a newInvalidInstanceStateExceptionwhich signals that the designated instance is in the designated execution and migration state and one of them prevents the desired action. The preventing state is specified by the boolean flag.- Parameters:
instanceID- The ID of the instance which is in the wrong state for the desired action.currentExecutionState- The current execution state of the instance.currentMigrationState- The current migration state of the instance.migrationPrevents- Whether it is the migration state that prevents the desired action (or the execution state instead).message- A message to display to the user.
-
-
Method Details
-
getInstanceID
Gets the execution status of the instance which has led to this exception or null in case a migration state has led to this exception.- Returns:
- The migration status of the instance which has led to this exception or null in case it an execution state has led to this exception.
-
getInstanceExecutionStatus
Gets the execution status of the instance which has led to this exception or null in case a migration state has led to this exception.- Returns:
- The execution status of the instance which has led to this exception or null in case a migration state has led to this exception.
-
getInstanceMigrationStatus
Gets the migration status of the instance which has led to this exception or null in case an execution state has led to this exception.- Returns:
- The migration status of the instance which has led to this exception or null in case an execution state has led to this exception.
-
getPreventingState
Gets the string representation of the state which prevents the desired action and which has led to this exception. This is either the name of the current migration state or the current execution state.- Returns:
- The name of the state which has led to this exception. This is either a migration or an execution state name.
-