Class InvalidWorkflowInstanceStatusException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.yworkflow.common.error.WorkflowException
com.yworkflow.instance.error.InvalidWorkflowInstanceStatusException
All Implemented Interfaces:
Serializable

public class InvalidWorkflowInstanceStatusException extends WorkflowException
Exception thrown when an invalid status transition is attempted on a workflow instance. InvalidWorkflowInstanceStatusException is used to indicate that a workflow instance cannot transition from its current status to the requested new status.

This exception is typically thrown when attempting to change the status of a workflow instance in a way that violates the workflow lifecycle rules, such as trying to complete an already completed instance or trying to start an instance that is already running.

The exception includes both the actual current status and the requested new status, allowing for detailed error reporting and debugging.

Since:
1.0
See Also:
  • Constructor Details

    • InvalidWorkflowInstanceStatusException

      public InvalidWorkflowInstanceStatusException(WorkflowInstanceStatus actualStatus, WorkflowInstanceStatus newStatus)
      Creates a new InvalidWorkflowInstanceStatusException with the specified statuses.
      Parameters:
      actualStatus - the current status of the workflow instance
      newStatus - the requested new status that is invalid
  • Method Details

    • getActualStatus

      public WorkflowInstanceStatus getActualStatus()
      Returns the actual current status of the workflow instance.
      Returns:
      the current status
    • getNewStatus

      public WorkflowInstanceStatus getNewStatus()
      Returns the requested new status that is invalid.
      Returns:
      the requested new status