Assembly: OptimaJet.Workflow.Core

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.

public class TransitionDefinition : BaseDefinition

Type Hierarchy

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; } #

Exceptions

Type
Description
WrongSubprocessMarkupException
TransitionDefinition.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
subprocessName
String
The literal name or C# expression used as TransitionDefinition.SubprocessName.
subprocessId
String
The text representation of a Guid or a substitution template used as ProcessInstance.ProcessId for the subprocess and assigned to TransitionDefinition.SubprocessId.
mergeViaSetState
Boolean
true to move the parent process directly to TransitionDefinition.To when finalizing the subprocess; false to evaluate automatic transitions from that activity.
disableParentStateControl
Boolean
true to ignore parent-process activity changes when determining whether to delete the subprocess automatically; otherwise, false.
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.

Returns

Type
Description
TransitionDefinition
The current TransitionDefinition instance.
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
from
ActivityDefinition
The source ActivityDefinition.
to
ActivityDefinition
The target ActivityDefinition.

Returns

Type
Description
TransitionDefinition
A new TransitionDefinition from from to to.
public void AddRestriction(RestrictionDefinition restriction) #

Parameters

Name
Type
Description
restriction
RestrictionDefinition
public TransitionDefinition Clone() #

Returns

Type
Description
TransitionDefinition
A 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
actorDefinitions
List<ActorDefinition>
The ActorDefinition instances used to rebind each RestrictionDefinition.Actor by matching actor names.
commandDefinitions
List<CommandDefinition>
The CommandDefinition instances used to rebind TriggerDefinition.Command by matching command names.
activityDefinitions
List<ActivityDefinition>
The ActivityDefinition instances used to rebind TransitionDefinition.From and TransitionDefinition.To by matching activity names.
timerDefinitions
List<TimerDefinition>
The TimerDefinition instances used to rebind TriggerDefinition.Timer by matching timer names.

Returns

Type
Description
TransitionDefinition
A new TransitionDefinition bound to matching supplied definitions.

Exceptions

Type
Description
ArgumentNullException
A collection needed to replace an assigned definition is null.
InvalidOperationException
A collection contains no definition with the required actor, command, activity, or timer name.

Remarks

public T GetAnnotation<T>(string name) #
Gets the Annotation.JsonValue identified by name and deserializes it to T.

Parameters

Name
Type
Description
name
String
The name used to find the Annotation in TransitionDefinition.Annotations.

Returns

Type
Description
{T}
The Annotation.JsonValue deserialized as T.
public string GetAnnotation(string name) #
Gets the Annotation.JsonValue of the annotation identified by name.

Parameters

Name
Type
Description
name
String
The annotation name to match against Annotation.Name.

Returns

Type
Description
String
The Annotation.JsonValue of the first annotation whose Annotation.Name matches name; otherwise, null.