# Class ActivityNotFoundException OptimaJet.Workflow.Core.Fault.ActivityNotFoundException Represents an exception thrown when an activity-related item cannot be found in a workflow scheme. Namespace: [OptimaJet.Workflow.Core.Fault](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/) ```csharp public class ActivityNotFoundException : Exception, ISerializable ``` ## Type Hierarchy - [Exception](https://learn.microsoft.com/dotnet/api/system.exception) - ActivityNotFoundException Current type - Implemented interfaces - [ISerializable](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.iserializable) ## Constructors `public ActivityNotFoundException(string message)` Initializes a new instance of the [ActivityNotFoundException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/ActivityNotFoundException/) class with a custom error message. ### Parameters | Name | Type | Description | | --- | --- | --- | | `message` | `String` | The message that explains why the exception was thrown. | `public ActivityNotFoundException(string activityName, string schemeCode)` Initializes a new instance of the [ActivityNotFoundException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/ActivityNotFoundException/) class for a missing activity name in a specific workflow scheme. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activityName` | `String` | The name of the activity that was not found. | | `schemeCode` | `String` | The workflow scheme code that was searched. | `public ActivityNotFoundException(string stateName, bool? isForSetState, string schemeCode)` Initializes a new instance of the [ActivityNotFoundException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/ActivityNotFoundException/) class for a missing activity state in a specific workflow scheme. ### Parameters | Name | Type | Description | | --- | --- | --- | | `stateName` | `String` | The name of the state that was not found. | | `isForSetState` | `Nullable` | Optional value included in the generated message when present. | | `schemeCode` | `String` | The workflow scheme code that was searched. | [Previous ActivityAlreadyExistsException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/ActivityAlreadyExistsException/) [Next ActorAlreadyExistsException](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Fault/ActorAlreadyExistsException/)