Class InvalidInstanceStateException

  • All Implemented Interfaces:
    Serializable

    public class InvalidInstanceStateException
    extends Exception
    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:
    Serialized Form
    • Field Detail

      • instanceID

        protected final UUID instanceID
        The ID of the instance which is in the wrong state for the desired action.
      • migrationPrevents

        protected final boolean migrationPrevents
        Whether the current migration state prevents the action (or the current execution state).
    • Constructor Detail

      • InvalidInstanceStateException

        public InvalidInstanceStateException​(UUID instanceID,
                                             ProcessConstants.InstanceExecutionStatus currentExecutionState,
                                             String message)
        Constructs a new InvalidInstanceStateException which 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 new InvalidInstanceStateException which 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 new InvalidInstanceStateException which 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 Detail

      • getInstanceID

        public UUID 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

        public ProcessConstants.InstanceExecutionStatus 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

        public ProcessConstants.InstanceMigrationStatus 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

        public String 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.