# Class TransitionDefinition OptimaJet.Workflow.Core.Model.TransitionDefinition Represents a transition that connects the source [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) activity to the target [TransitionDefinition.To](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) activity in a process scheme. Namespace: [OptimaJet.Workflow.Core.Model](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/) ```csharp public class TransitionDefinition : BaseDefinition ``` ## Type Hierarchy - [BaseDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) - TransitionDefinition Current type ## Properties `public string InlinedFinalActivityName { get; set; }` Gets or sets the [ActivityDefinition.OriginalName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) of the final activity from which this transition continues when an inline scheme is expanded. ### Remarks If the value is empty, the first final activity in the inline scheme is used. `public string OriginalName { get; set; }` Gets or sets the transition name from its source process scheme before it was first inlined. `public string OriginalSchemeCode { get; set; }` Gets or sets the code of the process scheme from which this transition was originally inlined. `public string LastTimeInlineName { get; set; }` Gets or sets the name of the inline [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) used when this transition was last copied into a parent process scheme. `public string FirstTimeInlineName { get; set; }` Gets or sets the name of the first inline [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) through which this transition was inlined. `public string UserComment { get; set; }` Gets or sets a user-defined comment for the transition. `public bool WasInlined { get; set; }` Gets or sets a value indicating whether this transition was copied into another process scheme during scheme inlining. `public ActivityDefinition From { get; set; }` Gets or sets the source [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) where the transition starts. `public ActivityDefinition To { get; set; }` Gets or sets the target [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) to which the process instance moves when the transition fires. `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public TransitionClassifier Classifier { get; set; }` Gets or sets the [TransitionClassifier](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionClassifier/) that classifies the direction of the transition. `public TriggerDefinition Trigger { get; set; }` Gets or sets the [TriggerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerDefinition/) that determines what causes the transition to fire. `public List Conditions { get; set; }` Gets or sets the [ConditionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConditionDefinition/) instances evaluated to determine whether the transition is eligible to fire. `public List Restrictions { get; set; }` Gets or sets the actor-based [RestrictionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) instances that determine whether a workflow participant identity is authorized to execute the command that triggers this transition. `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public ConcatenationType AllowConcatenationType { get; set; }` Gets or sets the [ConcatenationType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConcatenationType/) used to combine restrictions whose [RestrictionDefinition.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) is [RestrictionType.Allow](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionType/). `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public ConcatenationType RestrictConcatenationType { get; set; }` Gets or sets the [ConcatenationType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConcatenationType/) used to combine restrictions whose [RestrictionDefinition.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) is [RestrictionType.Restrict](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionType/). `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public ConcatenationType ConditionsConcatenationType { get; set; }` Gets or sets the [ConcatenationType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConcatenationType/) used to combine the conditions in [TransitionDefinition.Conditions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/). `public List Annotations { get; set; }` Gets or sets the [Annotation](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) instances that store custom metadata for this transition. `[JsonIgnore] [JsonIgnore] public bool HasExpressions { get; }` Gets a value indicating whether [TransitionDefinition.Conditions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) contains at least one [ConditionType.Expression](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConditionType/) condition with a non-empty [ConditionDefinition.Expression](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConditionDefinition/). `public bool IsFork { get; set; }` Gets or sets a value indicating whether this transition marks a boundary between a parent process and a subprocess. `public bool MergeViaSetState { get; set; }` Gets or sets a value indicating whether finalizing the subprocess directly moves the parent process to [TransitionDefinition.To](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) instead of evaluating automatic transitions that leave that activity. `public bool DisableParentStateControl { get; set; }` Gets or sets a value indicating whether parent-process activity changes are ignored when determining whether to delete the subprocess automatically. `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public SubprocessStartupType SubprocessStartupType { get; set; }` Gets or sets how the subprocess started by this transition is scheduled. `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public SubprocessInOutDefinition SubprocessInOutDefinition { get; set; }` Gets or sets whether this transition starts or finalizes a subprocess. `public string SubprocessName { get; set; }` Gets or sets a literal subprocess name or a C# expression evaluated to obtain the name. ### Remarks When [ExpressionsCompiler.CompilationEnable](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.CodeActions/ExpressionsCompiler/) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), a non-blank value that cannot be compiled as an expression is used as a literal name. If the value is blank, expression compilation is disabled, or an expression returns [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), the transition name is used. `public string SubprocessId { get; set; }` Gets or sets the text representation of a [Guid](https://learn.microsoft.com/dotnet/api/system.guid) or a substitution template used as the subprocess's [ProcessInstance.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). ### Remarks If the value is blank, [Guid.NewGuid()](https://learn.microsoft.com/dotnet/api/system.guid.newguid) generates the subprocess's [ProcessInstance.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) when the subprocess starts. `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public SubprocessStartupParameterCopyStrategy SubprocessStartupParameterCopyStrategy { get; set; }` Gets or sets which parent-process parameters are copied to the subprocess when it starts. `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public SubprocessFinalizeParameterMergeStrategy SubprocessFinalizeParameterMergeStrategy { get; set; }` Gets or sets how subprocess parameters are merged into the parent process when the subprocess is finalized. `public string SubprocessSpecifiedParameters { get; set; }` Gets or sets the comma- or space-separated parameter names used by [TransitionDefinition.SubprocessStartupParameterCopyStrategy](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) and [TransitionDefinition.SubprocessFinalizeParameterMergeStrategy](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) when their configured strategies operate on specified parameters. `public List SubprocessSpecifiedParametersList { get; }` Gets the parameter names parsed from [TransitionDefinition.SubprocessSpecifiedParameters](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/). ### Remarks Each name is trimmed, and empty entries are omitted. `public bool IsAlwaysTransition { get; }` Gets a value indicating whether [TransitionDefinition.Conditions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) contains at least one [ConditionType.Always](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConditionType/) condition. `public bool IsOtherwiseTransition { get; }` Gets a value indicating whether [TransitionDefinition.Conditions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) contains at least one [ConditionType.Otherwise](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConditionType/) condition. `public bool IsConditionTransition { get; }` Gets a value indicating whether every condition in [TransitionDefinition.Conditions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) has the type [ConditionType.Action](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConditionType/) or [ConditionType.Expression](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConditionType/). ### Remarks Returns [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when [TransitionDefinition.Conditions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) is empty. `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public TransitionForkType ForkType { get; }` Gets the [TransitionForkType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionForkType/) inferred from [TransitionDefinition.IsFork](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) and the [ActivityDefinition.NestingLevel](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) values of [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/). ### Exceptions | Type | Description | | --- | --- | | `WrongSubprocessMarkupException` | [TransitionDefinition.IsFork](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) and the source and target [ActivityDefinition.NestingLevel](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) values are equal. | ## Methods `public TransitionDefinition SetSubprocessSettings(string subprocessName, string subprocessId, bool mergeViaSetState, bool disableParentStateControl, SubprocessInOutDefinition inOutDefinition, SubprocessStartupType startupType, SubprocessStartupParameterCopyStrategy startupParameterCopyStrategy, SubprocessFinalizeParameterMergeStrategy finalizeParameterMergeStrategy, string subprocessSpecifiedParameters)` Marks this transition as a subprocess boundary and applies the specified subprocess settings. ### Parameters | Name | Type | Description | | --- | --- | --- | | `subprocessName` | `String` | The literal name or C# expression used as [TransitionDefinition.SubprocessName](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/). | | `subprocessId` | `String` | The text representation of a [Guid](https://learn.microsoft.com/dotnet/api/system.guid) or a substitution template used as [ProcessInstance.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) for the subprocess and assigned to [TransitionDefinition.SubprocessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/). | | `mergeViaSetState` | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) to move the parent process directly to [TransitionDefinition.To](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) when finalizing the subprocess; [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) to evaluate automatic transitions from that activity. | | `disableParentStateControl` | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) to ignore parent-process activity changes when determining whether to delete the subprocess automatically; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | | `inOutDefinition` | `SubprocessInOutDefinition` | Determines whether the transition starts or finalizes a subprocess. | | `startupType` | `SubprocessStartupType` | Determines how subprocess startup is scheduled. | | `startupParameterCopyStrategy` | `SubprocessStartupParameterCopyStrategy` | Determines which parent-process parameters are copied to the subprocess. | | `finalizeParameterMergeStrategy` | `SubprocessFinalizeParameterMergeStrategy` | Determines how subprocess parameters are merged into the parent process. | | `subprocessSpecifiedParameters` | `String` | The comma- or space-separated parameter names used by the specified parameter copy and merge strategies and assigned to [TransitionDefinition.SubprocessSpecifiedParameters](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/). | ### Returns | Type | Description | | --- | --- | | `TransitionDefinition` | The current [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) instance. | ### Remarks Sets [TransitionDefinition.IsFork](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) to [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). `public static TransitionDefinition Create(ActivityDefinition from, ActivityDefinition to)` Creates a transition with a [TransitionClassifier.NotSpecified](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionClassifier/) classifier, an [ConditionType.Always](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConditionType/) condition, and a [TriggerType.Auto](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerType/) trigger. ### Parameters | Name | Type | Description | | --- | --- | --- | | `from` | `ActivityDefinition` | The source [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). | | `to` | `ActivityDefinition` | The target [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/). | ### Returns | Type | Description | | --- | --- | | `TransitionDefinition` | A new [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) from `from` to `to`. | ### Remarks Sets the transition name to `Undefined` and [TransitionDefinition.AllowConcatenationType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/), [TransitionDefinition.RestrictConcatenationType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/), and [TransitionDefinition.ConditionsConcatenationType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) to [ConcatenationType.And](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ConcatenationType/). `public void AddRestriction(RestrictionDefinition restriction)` Adds `restriction` to [TransitionDefinition.Restrictions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `restriction` | `RestrictionDefinition` | The [RestrictionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) to add. | `public TransitionDefinition Clone()` Creates a copy of this transition and clones [TransitionDefinition.From](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/), [TransitionDefinition.To](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/), [TransitionDefinition.Trigger](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/), [TransitionDefinition.Conditions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/), [TransitionDefinition.Restrictions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/), and [TransitionDefinition.Annotations](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/). ### Returns | Type | Description | | --- | --- | | `TransitionDefinition` | A new [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) containing the copied transition data. | ### Remarks The copied transition retains the original [BaseDefinition.DesignerSettings](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) reference. `public TransitionDefinition Clone(List actorDefinitions, List commandDefinitions, List activityDefinitions, List timerDefinitions)` Creates a copy of this transition and rebinds its [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/), [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/), [CommandDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CommandDefinition/), and [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) references to definitions from the supplied collections. ### Parameters | Name | Type | Description | | --- | --- | --- | | `actorDefinitions` | `List` | The [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) instances used to rebind each [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) by matching actor names. | | `commandDefinitions` | `List` | The [CommandDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/CommandDefinition/) instances used to rebind [TriggerDefinition.Command](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerDefinition/) by matching command names. | | `activityDefinitions` | `List` | The [ActivityDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActivityDefinition/) instances used to rebind [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/) by matching activity names. | | `timerDefinitions` | `List` | The [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) instances used to rebind [TriggerDefinition.Timer](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TriggerDefinition/) by matching timer names. | ### Returns | Type | Description | | --- | --- | | `TransitionDefinition` | A new [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) bound to matching supplied definitions. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentNullException` | A collection needed to replace an assigned definition is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | | `InvalidOperationException` | A collection contains no definition with the required actor, command, activity, or timer name. | ### Remarks [TransitionDefinition.Conditions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) and [TransitionDefinition.Restrictions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) are cloned. The copied transition retains the original [TransitionDefinition.Annotations](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) and [BaseDefinition.DesignerSettings](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/BaseDefinition/) references. `public T GetAnnotation(string name)` Gets the [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) identified by `name` and deserializes it to `T`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The name used to find the [Annotation](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) in [TransitionDefinition.Annotations](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/). | ### Returns | Type | Description | | --- | --- | | `{T}` | The [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) deserialized as `T`. | `public string GetAnnotation(string name)` Gets the [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) of the annotation identified by `name`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The annotation name to match against [Annotation.Name](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/). | ### Returns | Type | Description | | --- | --- | | `String` | The [Annotation.JsonValue](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) of the first annotation whose [Annotation.Name](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/Annotation/) matches `name`; otherwise, [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | [Previous TransitionClassifier](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionClassifier/) [Next TransitionForkType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionForkType/)