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