# Class ProcessDefinition OptimaJet.Workflow.Core.Model.ProcessDefinition Represents the parsed and built form of a scheme used to create and execute process instances, including its activities, transitions, commands, parameters, timers, and other definitions. Namespace: [OptimaJet.Workflow.Core.Model](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/) ```csharp public sealed class ProcessDefinition : BaseDefinition ``` ## Type Hierarchy - [BaseDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) - ProcessDefinition Current type ## Constructors `public ProcessDefinition()` Initializes a new instance of the [ProcessDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) class with empty definition collections. ### Remarks Initializes [ProcessDefinition.Actors](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.Parameters](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.Commands](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.Timers](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.Comments](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.Activities](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.Transitions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.Localization](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.AdditionalParams](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.CodeActions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), and [ProcessDefinition.Tags](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). ## Properties `[JsonIgnore] [JsonIgnore] public CodeActionsInvoker CodeActionsInvoker { get; }` Gets the [ProcessDefinition.CodeActionsInvoker](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) that invokes compiled code actions represented by [CodeActionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionDefinition/) instances in this process scheme. `[JsonIgnore] [JsonIgnore] public ExpressionsInvoker ExpressionsInvoker { get; }` Gets the [ProcessDefinition.ExpressionsInvoker](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) that evaluates compiled [ConditionType.Expression](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConditionType/) conditions for this process scheme. `[JsonIgnore] [JsonIgnore] public SubprocessNameGetterInvoker SubprocessNameGetterInvoker { get; }` Gets the [ProcessDefinition.SubprocessNameGetterInvoker](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) that evaluates configured [TransitionDefinition.SubprocessName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) values for this process scheme. `[JsonIgnore] [JsonIgnore] public ExpressionManager ExpressionManager { get; }` Gets the [ProcessDefinition.ExpressionManager](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) that compiles, caches, and evaluates expressions for this process scheme. `public List Actors { get; set; }` Gets or sets the [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) instances available to the process scheme, including actors whose [ActorDefinition.IsPredefined](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) value is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). `public List Parameters { get; set; }` Gets or sets the [ParameterDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinition/) instances available to the process scheme, including definitions from [DefaultDefinitions.DefaultParameters](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/DefaultDefinitions/). `public List Commands { get; set; }` Gets or sets the [CommandDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CommandDefinition/) instances contained in the process scheme. `public List Timers { get; set; }` Gets or sets the [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) instances contained in the process scheme. `public List Comments { get; set; }` Gets or sets the [CommentDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CommentDefinition/) instances contained in the process scheme. `public List Activities { get; set; }` Gets or sets the [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) instances contained in the process scheme. `public List Transitions { get; set; }` Gets or sets the [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) instances contained in the process scheme. `public Localization Localization { get; set; }` Gets or sets the [Translation](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/) entries for the process scheme. `public Localizer Localizer { get; }` Gets a new [ProcessDefinition.Localizer](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) that resolves values from [ProcessDefinition.Localization](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). `public List CodeActions { get; set; }` Gets or sets the [CodeActionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionDefinition/) instances contained in the process scheme. `public string CodeActionsCommonUsings { get; set; }` Gets or sets the semicolon-delimited namespace imports shared when [CodeActionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CodeActionDefinition/) instances are compiled. `public Dictionary AdditionalParams { get; set; }` Gets or sets data supplied to Workflow Designer in addition to the process scheme model. `public bool CanBeInlined { get; set; }` Gets or sets a value indicating whether this process scheme can be inlined into another process scheme. `public bool LogEnabled { get; set; }` Gets or sets a value indicating whether logging is enabled by default through [ProcessInstance.LogEnabled](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) for process instances created from this scheme. `public List InlinedSchemes { get; }` Gets the distinct [ActivityDefinition.SchemeCode](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) values for activities whose [ActivityDefinition.ActivityType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) is [ActivityType.Inline](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityType/). `public string StartingTransition { get; set; }` Gets or sets the name of the [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) that started this subprocess scheme. `public List Tags { get; }` Gets the tags associated with the process scheme. `[JsonIgnore] [JsonIgnore] public bool ContainsSubprocesses { get; }` Gets a value indicating whether any transition has [TransitionDefinition.IsFork](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) set to [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). `[JsonIgnore] [JsonIgnore] public ActivityDefinition InitialActivity { get; }` Gets the first [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) in [ProcessDefinition.Activities](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) whose [ActivityDefinition.IsInitial](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) value is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool); otherwise, [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). `public ParameterDefinition[] ParametersForSerialize { get; }` Gets the [ParameterDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinition/) instances whose parameter names are not used by any definition in [DefaultDefinitions.DefaultParameters](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/DefaultDefinitions/), or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when [ProcessDefinition.Parameters](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). `public IEnumerable PersistenceParameters { get; }` Gets the parameter definitions whose [ParameterDefinition.Purpose](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinition/) is [ParameterPurpose.Persistence](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterPurpose/). `public ActorDefinition[] ActorsForSerialize { get; }` Gets the actor definitions whose [ActorDefinition.IsPredefined](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) value is [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when [ProcessDefinition.Actors](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). `public string RootSchemeCode { get; set; }` Gets or sets the code of the root process scheme for this subprocess scheme. `public Guid? RootSchemeId { get; set; }` Gets or sets the identifier of the root process scheme for this subprocess scheme. `public bool IsObsolete { get; set; }` Gets or sets a value indicating whether this process scheme is obsolete. `public Guid Id { get; set; }` Gets or sets the identifier of this process scheme. `public string TenantId { get; set; }` Gets or sets the tenant identifier associated with this process scheme. `public bool IsSubprocessScheme { get; }` Gets a value indicating whether [ProcessDefinition.RootSchemeId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) has a value different from [ProcessDefinition.Id](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). `public List AllowedActivities { get; set; }` Gets or sets the names of parent-process [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) instances during which this subprocess may remain active. `public string CalendarName { get; set; }` Gets or sets the scheme-level work calendar name used by [ProcessInstance.GetCalendar()](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) when [ProcessInstance.CalendarName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). ## Methods `public ActivityDefinition FindActivity(string activityName)` Finds the activity named `activityName` using [StringComparison.Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal). ### Parameters | Name | Type | Description | | --- | --- | --- | | `activityName` | `String` | The activity name to find. | ### Returns | Type | Description | | --- | --- | | `ActivityDefinition` | The matching [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). | ### Exceptions | Type | Description | | --- | --- | | `ActivityNotFoundException` | No activity is named `activityName`. | | `InvalidOperationException` | More than one activity is named `activityName`. | `public ActivityDefinition FindSetStateActivity(string stateName)` Finds the first activity that can be selected by business state name through [ActivityDefinition.IsForSetState](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `stateName` | `String` | The value to match against [ActivityDefinition.State](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) using [StringComparison.Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal). | ### Returns | Type | Description | | --- | --- | | `ActivityDefinition` | The matching [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). | ### Exceptions | Type | Description | | --- | --- | | `ActivityNotFoundException` | No activity has a nonempty [ActivityDefinition.State](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) equal to `stateName` and [ActivityDefinition.IsForSetState](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) set to [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | `public CommandDefinition FindCommand(string name)` Finds the command named `name` using [StringComparison.Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The command name to find. | ### Returns | Type | Description | | --- | --- | | `CommandDefinition` | The matching [CommandDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CommandDefinition/). | ### Exceptions | Type | Description | | --- | --- | | `CommandNotFoundException` | No command is named `name`. | | `InvalidOperationException` | More than one command is named `name`. | `public ActorDefinition FindActor(string name)` Finds the actor named `name` using [StringComparison.Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The actor name to find. | ### Returns | Type | Description | | --- | --- | | `ActorDefinition` | The matching [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/). | ### Exceptions | Type | Description | | --- | --- | | `ActorNotFoundException` | No actor is named `name`. | | `InvalidOperationException` | More than one actor is named `name`. | `public ParameterDefinition FindParameterDefinition(string name)` Finds the parameter named `name` using [StringComparison.Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The parameter name to find. | ### Returns | Type | Description | | --- | --- | | `ParameterDefinition` | The matching [ParameterDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ParameterDefinition/), or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) if no match exists. | ### Exceptions | Type | Description | | --- | --- | | `InvalidOperationException` | More than one parameter is named `name`. | `public TransitionDefinition FindTransition(string name)` Finds the transition named `name` using [StringComparison.Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The transition name to find. | ### Returns | Type | Description | | --- | --- | | `TransitionDefinition` | The matching [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/). | ### Exceptions | Type | Description | | --- | --- | | `TransitionNotFoundException` | No transition is named `name`. | | `InvalidOperationException` | More than one transition is named `name`. | `public List FindTransitions(ActivityDefinition from, ActivityDefinition to)` Finds transitions whose [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) and [TransitionDefinition.To](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) activity names match `from` and `to`, respectively, using [StringComparison.Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal). ### Parameters | Name | Type | Description | | --- | --- | --- | | `from` | `ActivityDefinition` | The source [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) whose name must match. | | `to` | `ActivityDefinition` | The destination [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) whose name must match. | ### Returns | Type | Description | | --- | --- | | `List` | A list of matching [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) instances. | `public IEnumerable GetPossibleTransitionsForActivity(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)` Gets transitions whose [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) references `activity` and whose [TransitionDefinition.IsFork](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) value matches `forkTransitionSearch`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activity` | `ActivityDefinition` | The source [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). | | `forkTransitionSearch` | `ForkTransitionSearchType` | The [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) filter to apply. | ### Returns | Type | Description | | --- | --- | | `IEnumerable` | The matching [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) instances. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentOutOfRangeException` | Thrown while enumerating the result if a candidate transition is evaluated and `forkTransitionSearch` is not a defined [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) value. | `public IEnumerable GetCommandTransitions(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)` Gets transitions whose [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) references `activity`, whose [TriggerDefinition.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerDefinition/) is [TriggerType.Command](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerType/), and whose [TransitionDefinition.IsFork](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) value matches `forkTransitionSearch`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activity` | `ActivityDefinition` | The source [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). | | `forkTransitionSearch` | `ForkTransitionSearchType` | The [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) filter to apply. | ### Returns | Type | Description | | --- | --- | | `IEnumerable` | The matching command-triggered [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) instances. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentOutOfRangeException` | Thrown while enumerating the result if a candidate transition is evaluated and `forkTransitionSearch` is not a defined [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) value. | `public IEnumerable GetAutoTransitionForActivity(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)` Gets transitions whose [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) references `activity`, whose [TriggerDefinition.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerDefinition/) is [TriggerType.Auto](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerType/), and whose [TransitionDefinition.IsFork](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) value matches `forkTransitionSearch`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activity` | `ActivityDefinition` | The source [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). | | `forkTransitionSearch` | `ForkTransitionSearchType` | The [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) filter to apply. | ### Returns | Type | Description | | --- | --- | | `IEnumerable` | The matching automatically triggered [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) instances. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentOutOfRangeException` | Thrown while enumerating the result if a candidate transition is evaluated and `forkTransitionSearch` is not a defined [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) value. | `public IEnumerable GetCommandTransitionForActivity(ActivityDefinition activity, string commandName, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)` Gets transitions whose [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) references `activity`, whose [TriggerDefinition.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerDefinition/) is [TriggerType.Command](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerType/), whose [TriggerDefinition.Command](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerDefinition/) name matches `commandName` using [StringComparison.Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal), and whose [TransitionDefinition.IsFork](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) value matches `forkTransitionSearch`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activity` | `ActivityDefinition` | The source [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). | | `commandName` | `String` | The command name to match. | | `forkTransitionSearch` | `ForkTransitionSearchType` | The [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) filter to apply. | ### Returns | Type | Description | | --- | --- | | `IEnumerable` | The matching command-triggered [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) instances. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentOutOfRangeException` | Thrown while enumerating the result if a candidate transition is evaluated and `forkTransitionSearch` is not a defined [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) value. | `public IEnumerable GetTimerTransitionForActivity(ActivityDefinition activity, ForkTransitionSearchType forkTransitionSearch = ForkTransitionSearchType.NotFork)` Gets transitions whose [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) references `activity`, whose [TriggerDefinition.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerDefinition/) is [TriggerType.Timer](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerType/), and whose [TransitionDefinition.IsFork](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) value matches `forkTransitionSearch`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activity` | `ActivityDefinition` | The source [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). | | `forkTransitionSearch` | `ForkTransitionSearchType` | The [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) filter to apply. | ### Returns | Type | Description | | --- | --- | | `IEnumerable` | The matching timer-triggered [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) instances. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentOutOfRangeException` | Thrown while enumerating the result if a candidate transition is evaluated and `forkTransitionSearch` is not a defined [ForkTransitionSearchType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ForkTransitionSearchType/) value. | `public string GetLocalizedStateName(string name, CultureInfo culture = null)` Gets the localized business state name for `name` by using [LocalizeType.State](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/LocalizeType/) entries in [ProcessDefinition.Localization](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The business state name matched against [Translation.ObjectName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/). | | `culture` | `CultureInfo` | The culture to use, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to use [CultureInfo.CurrentCulture](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.currentculture). | ### Returns | Type | Description | | --- | --- | | `String` | The localized business state name, or `name` when no matching [Translation.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/) is available. | `public string GetLocalizedCommandName(string name, CultureInfo culture = null)` Gets the localized command name for `name` by using [LocalizeType.Command](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/LocalizeType/) entries in [ProcessDefinition.Localization](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The command name matched against [Translation.ObjectName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/). | | `culture` | `CultureInfo` | The culture to use, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to use [CultureInfo.CurrentCulture](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.currentculture). | ### Returns | Type | Description | | --- | --- | | `String` | The localized command name, or `name` when no matching [Translation.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/) is available. | `public string GetLocalizedParameterName(string name, CultureInfo culture = null)` Gets the localized parameter name for `name` by using [LocalizeType.Parameter](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/LocalizeType/) entries in [ProcessDefinition.Localization](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The parameter name matched against [Translation.ObjectName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/). | | `culture` | `CultureInfo` | The culture to use, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to use [CultureInfo.CurrentCulture](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.currentculture). | ### Returns | Type | Description | | --- | --- | | `String` | The localized parameter name, or `name` when no matching [Translation.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/) is available. | `public string GetLocalizedActionName(string name, CultureInfo culture = null)` Gets the localized action name for `name` by using [LocalizeType.Action](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/LocalizeType/) entries in [ProcessDefinition.Localization](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The action name matched against [Translation.ObjectName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/). | | `culture` | `CultureInfo` | The culture to use, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to use [CultureInfo.CurrentCulture](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.currentculture). | ### Returns | Type | Description | | --- | --- | | `String` | The localized action name, or `name` when no matching [Translation.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/) is available. | `public string GetLocalizedConditionName(string name, CultureInfo culture = null)` Gets the localized condition name for `name` by using [LocalizeType.Condition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/LocalizeType/) entries in [ProcessDefinition.Localization](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The condition name matched against [Translation.ObjectName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/). | | `culture` | `CultureInfo` | The culture to use, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to use [CultureInfo.CurrentCulture](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.currentculture). | ### Returns | Type | Description | | --- | --- | | `String` | The localized condition name, or `name` when no matching [Translation.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/) is available. | `public string GetLocalizedSchemeName(CultureInfo culture = null)` Gets the localized name of this process scheme by using [LocalizeType.Scheme](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/LocalizeType/) entries in [ProcessDefinition.Localization](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `culture` | `CultureInfo` | The culture to use, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to use [CultureInfo.CurrentCulture](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.currentculture). | ### Returns | Type | Description | | --- | --- | | `String` | The localized process scheme name, or the original process scheme name when no matching [Translation.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/) is available. | `public string GetLocalizedComment(string key, CultureInfo culture = null)` Gets the localized comment for `key` by using [LocalizeType.Comment](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/LocalizeType/) entries in [ProcessDefinition.Localization](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `key` | `String` | The comment key matched against [Translation.ObjectName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/). | | `culture` | `CultureInfo` | The culture to use, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to use [CultureInfo.CurrentCulture](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.currentculture). | ### Returns | Type | Description | | --- | --- | | `String` | The localized comment, or `key` when no matching [Translation.Value](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Translation/) is available. | `public ProcessDefinition Clone()` Creates a copy of this process definition by calling [ProcessDefinition.Clone(bool, bool, bool)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) with all omission options set to [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). ### Returns | Type | Description | | --- | --- | | `ProcessDefinition` | A new [ProcessDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) that includes the [ProcessDefinition.Activities](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), [ProcessDefinition.Transitions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/), and [ProcessDefinition.CodeActions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) collections. | `public ProcessDefinition Clone(bool doNotCloneActivities, bool doNotCloneTransitions, bool doNotCloneCodeActions)` Creates a copy of this process definition and optionally omits selected definition collections. ### Parameters | Name | Type | Description | | --- | --- | --- | | `doNotCloneActivities` | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) to leave [ProcessDefinition.Activities](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) empty in the copy; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | | `doNotCloneTransitions` | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) to leave [ProcessDefinition.Transitions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) empty in the copy; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | | `doNotCloneCodeActions` | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) to leave [ProcessDefinition.CodeActions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) empty in the copy; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | ### Returns | Type | Description | | --- | --- | | `ProcessDefinition` | A new [ProcessDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) containing copies of the definition collections not omitted by `doNotCloneActivities`, `doNotCloneTransitions`, and `doNotCloneCodeActions`. | ### Exceptions | Type | Description | | --- | --- | | `InvalidOperationException` | A reference in [CommandDefinition.InputParameters](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CommandDefinition/) or a copied [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) cannot be rebound to a matching definition in the copied collections. | ### Remarks Members that this method does not explicitly recreate retain their original references, including [BaseDefinition.DesignerSettings](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) and [ProcessDefinition.AllowedActivities](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). [ProcessDefinition.AdditionalParams](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) is a new dictionary whose values retain their original references. `public string GetSchemeCodeForActionCall()` Gets the process scheme code used for scheme-scoped action, condition, rule, and external-parameter calls. ### Returns | Type | Description | | --- | --- | | `String` | [ProcessDefinition.RootSchemeCode](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) when [ProcessDefinition.IsSubprocessScheme](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) and the root scheme code is not empty; otherwise, this process scheme's name. | `public string Serialize()` Serializes the process scheme to XML by using [ProcessDefinition.SerializeToXElement()](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessDefinition/). ### Returns | Type | Description | | --- | --- | | `String` | The formatted XML representation of the process scheme. | `public XElement SerializeToXElement()` Serializes this definition to an [XElement](https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement) in Workflow Engine process-scheme format. ### Returns | Type | Description | | --- | --- | | `XElement` | An [XElement](https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement) whose root element is `Process`. | `public T GetActivityAnnotation(string activityName, string name)` Gets an annotation from the [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) selected by `activityName` and deserializes its [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) to `T`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activityName` | `String` | The activity name used to select an activity. | | `name` | `String` | The value matched against [Annotation.Name](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/). | ### Returns | Type | Description | | --- | --- | | `{T}` | The matching [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) deserialized as `T`. | ### Exceptions | Type | Description | | --- | --- | | `ActivityNotFoundException` | No activity is named `activityName`. | | `InvalidOperationException` | More than one activity is named `activityName`. | `public string GetActivityAnnotation(string activityName, string name)` Gets the stored [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) from the [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) selected by `activityName`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `activityName` | `String` | The activity name used to select an activity. | | `name` | `String` | The value matched against [Annotation.Name](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/). | ### Returns | Type | Description | | --- | --- | | `String` | The matching [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/), or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the activity has no annotation named `name`. | ### Exceptions | Type | Description | | --- | --- | | `ActivityNotFoundException` | No activity is named `activityName`. | | `InvalidOperationException` | More than one activity is named `activityName`. | `public T GetTransitionAnnotation(string transitionName, string name)` Gets an annotation from the [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) selected by `transitionName` and deserializes its [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) to `T`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `transitionName` | `String` | The transition name used to select a transition. | | `name` | `String` | The value matched against [Annotation.Name](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/). | ### Returns | Type | Description | | --- | --- | | `{T}` | The matching [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) deserialized as `T`. | ### Exceptions | Type | Description | | --- | --- | | `TransitionNotFoundException` | No transition is named `transitionName`. | | `InvalidOperationException` | More than one transition is named `transitionName`. | `public string GetTransitionAnnotation(string transitionName, string name)` Gets the stored [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) from the [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) selected by `transitionName`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `transitionName` | `String` | The transition name used to select a transition. | | `name` | `String` | The value matched against [Annotation.Name](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/). | ### Returns | Type | Description | | --- | --- | | `String` | The matching [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/), or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the transition has no annotation named `name`. | ### Exceptions | Type | Description | | --- | --- | | `TransitionNotFoundException` | No transition is named `transitionName`. | | `InvalidOperationException` | More than one transition is named `transitionName`. | [Previous PersistenceParametersBatch](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/PersistenceParametersBatch/) [Next ProcessInstance](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/)