# Class CommandNotValidForStateException OptimaJet.Workflow.Core.Fault.CommandNotValidForStateException Represents an exception that is thrown when a command is not valid for the current workflow state. Namespace: [OptimaJet.Workflow.Core.Fault](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/) ```csharp public class CommandNotValidForStateException : Exception, ISerializable ``` ## Type Hierarchy - [Exception](https://learn.microsoft.com/dotnet/api/system.exception) - CommandNotValidForStateException Current type - Implemented interfaces - [ISerializable](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.iserializable) [Previous CommandNotValidException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/CommandNotValidException/) [Next CommandParameterAlreadyExistsException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/CommandParameterAlreadyExistsException/)