Assembly: OptimaJet.Workflow.Core

Class ConditionDefinition

OptimaJet.Workflow.Core.Model.ConditionDefinition

Represents a bool guard in TransitionDefinition.Conditions that determines whether a transition can be selected.

public sealed class ConditionDefinition

Properties

[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<ConditionType>))] public ConditionType Type { get; set; } #
Gets or sets the ConditionType that determines how the condition is evaluated.
public ActionDefinitionReference Action { get; set; } #
Gets or sets the ActionDefinitionReference that identifies the condition logic evaluated when ConditionDefinition.Type is ConditionType.Action.
public string Expression { get; set; } #
Gets or sets the C# bool expression evaluated when ConditionDefinition.Type is ConditionType.Expression.
public bool? ResultOnPreExecution { get; set; } #
Gets or sets the condition result to use during pre-execution simulation.
public bool ConditionInversion { get; set; } #
Gets or sets a value indicating whether to negate the evaluated result of a ConditionType.Action or ConditionType.Expression condition.
public static ConditionDefinition Always { get; } #
public static ConditionDefinition Otherwise { get; } #

Methods

public ConditionDefinition Clone() #
Creates a copy of this condition and clones its ConditionDefinition.Action reference when present.

Returns

Type
Description
ConditionDefinition
A new ConditionDefinition containing the copied condition data.
public static ConditionDefinition CreateAlwaysCondition() #
Creates a condition whose ConditionDefinition.Type is ConditionType.Always.

Returns

Type
Description
ConditionDefinition
A new ConditionDefinition that is always satisfied.
public static ConditionDefinition CreateOtherwiseCondition() #

Returns

Type
Description
ConditionDefinition
A new fallback ConditionDefinition.
public static ConditionDefinition CreateActionCondition(ActionDefinitionReference action, bool conditionInversion, bool? resultOnPreExecution) #
Creates a ConditionType.Action condition that evaluates action.

Parameters

Name
Type
Description
action
ActionDefinitionReference
The ActionDefinitionReference to assign to ConditionDefinition.Action. It identifies the condition logic to evaluate.
conditionInversion
Boolean
resultOnPreExecution
Nullable<Boolean>
The value to assign to ConditionDefinition.ResultOnPreExecution: true or false for a fixed result, or null to evaluate the condition normally.

Returns

Type
Description
public static ConditionDefinition CreateExpressionCondition(string expression, bool conditionInversion, bool? resultOnPreExecution) #
Creates a ConditionType.Expression condition that evaluates expression.

Parameters

Name
Type
Description
expression
String
The C# bool expression to assign to ConditionDefinition.Expression.
conditionInversion
Boolean
resultOnPreExecution
Nullable<Boolean>
The value to assign to ConditionDefinition.ResultOnPreExecution: true or false for a fixed result, or null to evaluate the expression normally.

Returns

Type
Description