Assembly: OptimaJet.Workflow.Core

Class TriggerDefinition

OptimaJet.Workflow.Core.Model.TriggerDefinition

Represents a transition trigger assigned to TransitionDefinition.Trigger in a process scheme.

public class TriggerDefinition

Constructors

public TriggerDefinition(TriggerType type) #
Initializes a new TriggerDefinition with type.

Parameters

Name
Type
Description
type
TriggerType
The value to assign to TriggerDefinition.Type.

Properties

[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<TriggerType>))] public TriggerType Type { get; set; } #
Gets or sets the TriggerType that determines what causes the transition to be evaluated.
public string NameRef { get; } #
Gets the name of the CommandDefinition or TimerDefinition associated with this trigger.
public CommandDefinition Command { get; set; } #
Gets or sets the CommandDefinition associated with a TriggerType.Command trigger.
public TimerDefinition Timer { get; set; } #
Gets or sets the TimerDefinition associated with a TriggerType.Timer trigger.
public static TriggerDefinition Auto { get; } #

Methods

public static TriggerDefinition Create(string type) #
Creates a TriggerDefinition by parsing type as a TriggerType value.

Parameters

Name
Type
Description
type
String
The string representation of a TriggerType value.

Returns

Type
Description
TriggerDefinition

Exceptions

Type
Description
ArgumentNullException
type is null.
ArgumentException
type is empty, contains only white-space characters, or cannot be parsed as a TriggerType value.
OverflowException
type represents a numeric value outside the range of the underlying type.

Remarks

Name parsing is case-sensitive.
public static TriggerDefinition CreateTimerTrigger(TimerDefinition timer) #
Creates a TriggerType.Timer trigger associated with timer.

Parameters

Name
Type
Description
timer
TimerDefinition
The TimerDefinition to associate with the trigger.

Returns

Type
Description
TriggerDefinition
A new TriggerDefinition associated with timer.
public static TriggerDefinition CreateCommandTrigger(CommandDefinition command) #
Creates a TriggerType.Command trigger associated with command.

Parameters

Name
Type
Description
command
CommandDefinition
The CommandDefinition to associate with the trigger.

Returns

Type
Description
TriggerDefinition
A new TriggerDefinition associated with command.
public TriggerDefinition Clone() #
Creates a copy of this trigger and clones its associated CommandDefinition and TimerDefinition instances when present.

Returns

Type
Description
TriggerDefinition
A new TriggerDefinition containing the copied trigger data.
public TriggerDefinition Clone(List<CommandDefinition> commandDefinitions, List<TimerDefinition> timerDefinitions) #
Creates a copy of this trigger and rebinds TriggerDefinition.Command and TriggerDefinition.Timer by matching command and timer names in commandDefinitions and timerDefinitions.

Parameters

Name
Type
Description
commandDefinitions
List<CommandDefinition>
The CommandDefinition instances used to replace TriggerDefinition.Command.
timerDefinitions
List<TimerDefinition>
The TimerDefinition instances used to replace TriggerDefinition.Timer.

Returns

Type
Description
TriggerDefinition
A new TriggerDefinition bound to matching definitions from commandDefinitions and timerDefinitions.

Exceptions

Type
Description
ArgumentNullException
TriggerDefinition.Command is assigned and commandDefinitions is null, or TriggerDefinition.Timer is assigned and timerDefinitions is null.
InvalidOperationException
A required collection contains no definition with the matching command or timer name.