Class TransitionDefinition
OptimaJet.Workflow.Core.Model.TransitionDefinition
Represents a transition that connects the source TransitionDefinition.From activity to the target TransitionDefinition.To activity in a process scheme.
Namespace: OptimaJet.Workflow.Core.Model
public class TransitionDefinition : BaseDefinitionType Hierarchy
- BaseDefinition
- TransitionDefinition Current type
Properties
public string InlinedFinalActivityName { get; set; } #Gets or sets the ActivityDefinition.OriginalName 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 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 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 where the transition starts.
public ActivityDefinition To { get; set; } #Gets or sets the target ActivityDefinition to which the process instance moves when the transition fires.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<TransitionClassifier>))] public TransitionClassifier Classifier { get; set; } #Gets or sets the TransitionClassifier that classifies the direction of the transition.
public TriggerDefinition Trigger { get; set; } #Gets or sets the TriggerDefinition that determines what causes the transition to fire.
public List<ConditionDefinition> Conditions { get; set; } #Gets or sets the ConditionDefinition instances evaluated to determine whether the transition is eligible to fire.
public List<RestrictionDefinition> Restrictions { get; set; } #Gets or sets the actor-based 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<ConcatenationType>))] public ConcatenationType AllowConcatenationType { get; set; } #Gets or sets the ConcatenationType used to combine restrictions whose RestrictionDefinition.Type is RestrictionType.Allow.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<ConcatenationType>))] public ConcatenationType RestrictConcatenationType { get; set; } #Gets or sets the ConcatenationType used to combine restrictions whose RestrictionDefinition.Type is RestrictionType.Restrict.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<ConcatenationType>))] public ConcatenationType ConditionsConcatenationType { get; set; } #Gets or sets the ConcatenationType used to combine the conditions in TransitionDefinition.Conditions.
public List<Annotation> Annotations { get; set; } #Gets or sets the Annotation instances that store custom metadata for this transition.
[JsonIgnore] [JsonIgnore] public bool HasExpressions { get; } #Gets a value indicating whether TransitionDefinition.Conditions contains at least one ConditionType.Expression condition with a non-empty ConditionDefinition.Expression.
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 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<SubprocessStartupType>))] public SubprocessStartupType SubprocessStartupType { get; set; } #Gets or sets how the subprocess started by this transition is scheduled.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<SubprocessInOutDefinition>))] 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 is true, 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, the transition name is used.
public string SubprocessId { get; set; } #Gets or sets the text representation of a Guid or a substitution template used as the subprocess's ProcessInstance.ProcessId.
Remarks
If the value is blank, Guid.NewGuid() generates the subprocess's ProcessInstance.ProcessId when the subprocess starts.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<SubprocessStartupParameterCopyStrategy>))] 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<SubprocessFinalizeParameterMergeStrategy>))] 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 and TransitionDefinition.SubprocessFinalizeParameterMergeStrategy when their configured strategies operate on specified parameters.
public List<string> SubprocessSpecifiedParametersList { get; } #Gets the parameter names parsed from TransitionDefinition.SubprocessSpecifiedParameters.
Remarks
Each name is trimmed, and empty entries are omitted.
public bool IsAlwaysTransition { get; } #Gets a value indicating whether TransitionDefinition.Conditions contains at least one ConditionType.Always condition.
public bool IsOtherwiseTransition { get; } #Gets a value indicating whether TransitionDefinition.Conditions contains at least one ConditionType.Otherwise condition.
public bool IsConditionTransition { get; } #Gets a value indicating whether every condition in TransitionDefinition.Conditions has the type ConditionType.Action or ConditionType.Expression.
Remarks
Returns true when TransitionDefinition.Conditions is empty.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<TransitionForkType>))] public TransitionForkType ForkType { get; } #Gets the TransitionForkType inferred from TransitionDefinition.IsFork and the ActivityDefinition.NestingLevel values of TransitionDefinition.From and TransitionDefinition.To.
Exceptions
Type
Description
WrongSubprocessMarkupExceptionTransitionDefinition.IsFork is true and the source and target ActivityDefinition.NestingLevel 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
subprocessIdStringThe text representation of a Guid or a substitution template used as ProcessInstance.ProcessId for the subprocess and assigned to TransitionDefinition.SubprocessId.
mergeViaSetStateBooleantrue to move the parent process directly to TransitionDefinition.To when finalizing the subprocess; false to evaluate automatic transitions from that activity.
disableParentStateControlBooleaninOutDefinitionSubprocessInOutDefinitionDetermines whether the transition starts or finalizes a subprocess.
startupTypeSubprocessStartupTypeDetermines how subprocess startup is scheduled.
startupParameterCopyStrategySubprocessStartupParameterCopyStrategyDetermines which parent-process parameters are copied to the subprocess.
finalizeParameterMergeStrategySubprocessFinalizeParameterMergeStrategyDetermines how subprocess parameters are merged into the parent process.
subprocessSpecifiedParametersStringThe comma- or space-separated parameter names used by the specified parameter copy and merge strategies and assigned to TransitionDefinition.SubprocessSpecifiedParameters.
Returns
Type
Description
TransitionDefinitionThe current TransitionDefinition instance.
Remarks
Sets TransitionDefinition.IsFork to true.
public static TransitionDefinition Create(ActivityDefinition from, ActivityDefinition to) #Creates a transition with a TransitionClassifier.NotSpecified classifier, an ConditionType.Always condition, and a TriggerType.Auto trigger.
Parameters
Name
Type
Description
Returns
Type
Description
TransitionDefinitionRemarks
Sets the transition name to
Undefined and TransitionDefinition.AllowConcatenationType, TransitionDefinition.RestrictConcatenationType, and TransitionDefinition.ConditionsConcatenationType to ConcatenationType.And.public void AddRestriction(RestrictionDefinition restriction) #Adds
restriction to TransitionDefinition.Restrictions.Parameters
Name
Type
Description
public TransitionDefinition Clone() #Creates a copy of this transition and clones TransitionDefinition.From, TransitionDefinition.To, TransitionDefinition.Trigger, TransitionDefinition.Conditions, TransitionDefinition.Restrictions, and TransitionDefinition.Annotations.
Returns
Type
Description
TransitionDefinitionA new TransitionDefinition containing the copied transition data.
Remarks
The copied transition retains the original BaseDefinition.DesignerSettings reference.
public TransitionDefinition Clone(List<ActorDefinition> actorDefinitions, List<CommandDefinition> commandDefinitions, List<ActivityDefinition> activityDefinitions, List<TimerDefinition> timerDefinitions) #Creates a copy of this transition and rebinds its ActivityDefinition, ActorDefinition, CommandDefinition, and TimerDefinition references to definitions from the supplied collections.
Parameters
Name
Type
Description
actorDefinitionsList<ActorDefinition>The ActorDefinition instances used to rebind each RestrictionDefinition.Actor by matching actor names.
commandDefinitionsList<CommandDefinition>The CommandDefinition instances used to rebind TriggerDefinition.Command by matching command names.
activityDefinitionsList<ActivityDefinition>The ActivityDefinition instances used to rebind TransitionDefinition.From and TransitionDefinition.To by matching activity names.
timerDefinitionsList<TimerDefinition>The TimerDefinition instances used to rebind TriggerDefinition.Timer by matching timer names.
Returns
Type
Description
TransitionDefinitionA new TransitionDefinition bound to matching supplied definitions.
Exceptions
Type
Description
ArgumentNullExceptionA collection needed to replace an assigned definition is null.
InvalidOperationExceptionA collection contains no definition with the required actor, command, activity, or timer name.
Remarks
TransitionDefinition.Conditions and TransitionDefinition.Restrictions are cloned. The copied transition retains the original TransitionDefinition.Annotations and BaseDefinition.DesignerSettings references.
public T GetAnnotation<T>(string name) #public string GetAnnotation(string name) #Gets the Annotation.JsonValue of the annotation identified by
name.Parameters
Name
Type
Description
Returns
Type
Description
StringThe Annotation.JsonValue of the first annotation whose Annotation.Name matches
name; otherwise, null.