# Class CodeActionDefinition OptimaJet.Workflow.Core.Model.CodeActionDefinition Represents the source code and compilation settings for a Code Action that Workflow Engine invokes as an action, condition, or rule. Namespace: [OptimaJet.Workflow.Core.Model](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/) ```csharp public class CodeActionDefinition : BaseDefinition ``` ## Type Hierarchy - [BaseDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) - CodeActionDefinition Current type ## Properties `public string OriginalName { get; set; }` Gets or sets the Code Action name before this Code Action was first inlined into another process scheme. `public string OriginalSchemeCode { get; set; }` Gets or sets the code of the process scheme from which this Code Action was first inlined. `public bool WasInlined { get; set; }` Gets or sets a value indicating whether scheme inlining copied this Code Action from another process scheme. `public string ActionCode { get; set; }` Gets or sets the C# method body compiled for this Code Action. `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public CodeActionType Type { get; set; }` Gets or sets the [CodeActionType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionType/) that determines how this Code Action is compiled and invoked. `public bool IsGlobal { get; set; }` Gets or sets a value indicating whether this Code Action is stored in Workflow Engine global parameters and made available across process schemes. `public bool IsAsync { get; set; }` Gets or sets a value indicating whether this Code Action is compiled and invoked asynchronously. `public string Usings { get; set; }` Gets or sets the semicolon-separated namespace imports added when this Code Action is compiled. `public string ExcludedUsings { get; set; }` Gets or sets the semicolon-separated namespace imports excluded when this Code Action is compiled. `public List ParameterDefinitions { get; set; }` Gets or sets the ordered [CodeActionParameterDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionParameterDefinition/) form-field definitions used by Workflow Designer to build the structured editor for this Code Action's parameter. ### Remarks A nonempty collection takes precedence over the format supplied by [IDesignerParameterFormatProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/IDesignerParameterFormatProvider/) for the matching Code Action. ## Methods `public CodeActionDefinition Clone()` Creates a copy of this [CodeActionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionDefinition/). ### Returns | Type | Description | | --- | --- | | `CodeActionDefinition` | A new [CodeActionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionDefinition/) with cloned [BaseDefinition.DesignerSettings](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) and a separate [CodeActionDefinition.ParameterDefinitions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionDefinition/) list containing cloned [CodeActionParameterDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionParameterDefinition/) instances. | ### Exceptions | Type | Description | | --- | --- | | `NullReferenceException` | [BaseDefinition.DesignerSettings](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | ### Remarks The returned [CodeActionDefinition.ParameterDefinitions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionDefinition/) list is empty when this instance's [CodeActionDefinition.ParameterDefinitions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionDefinition/) value is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). [Previous BaseDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) [Next CodeActionParameterDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionParameterDefinition/)