Class ConditionDefinition
OptimaJet.Workflow.Core.Model.ConditionDefinition
Represents a bool guard in TransitionDefinition.Conditions that determines whether a transition can be selected.
Namespace: OptimaJet.Workflow.Core.Model
public sealed class ConditionDefinitionProperties
[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
ConditionDefinitionA new ConditionDefinition containing the copied condition data.
public static ConditionDefinition CreateAlwaysCondition() #Creates a condition whose ConditionDefinition.Type is ConditionType.Always.
Returns
Type
Description
ConditionDefinitionA new ConditionDefinition that is always satisfied.
public static ConditionDefinition CreateOtherwiseCondition() #Creates a condition whose ConditionDefinition.Type is ConditionType.Otherwise.
Returns
Type
Description
ConditionDefinitionA 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
actionActionDefinitionReferenceThe ActionDefinitionReference to assign to ConditionDefinition.Action. It identifies the condition logic to evaluate.
resultOnPreExecutionNullable<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
ConditionDefinitionpublic static ConditionDefinition CreateExpressionCondition(string expression, bool conditionInversion, bool? resultOnPreExecution) #Creates a ConditionType.Expression condition that evaluates
expression.Parameters
Name
Type
Description
resultOnPreExecutionNullable<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
ConditionDefinition