Skip to content

RuleCondition

Class in Oadm.Sdk.Events · Oadm.Sdk.dll

One condition. Simple mode: the conditions of a rule must all hold. The first is the trigger (an event); only the trigger may be stateless. Advanced mode (AND / OR groups) will extend this model.

public sealed class RuleCondition
List<RuleCheck> Checks { get; set; }

The checks on the event’s values (SDK 0.9.0), at most RuleChecks.MaxPerCondition; all must hold. JSON [{"field","op","value"}].

Dictionary<string, string> Data { get; set; }

Older rules: every listed event data field must equal its value (case-insensitive). Kept as they are (an unchanged older rule saves as before) and read as RuleCheckOperator.Eq checks by RuleCondition.AllChecks.

DeviceSelector Devices { get; set; }

The devices whose event counts.

string? EventTypeId { get; set; }

The event type of an event condition.

RuleConditionKind Kind { get; set; }

An event or a schedule.

RuleSchedule? Schedule { get; set; }

The time window of a schedule condition.

IReadOnlyList<RuleCheck> AllChecks()

Every check of the condition (SDK 0.9.0): RuleCondition.Checks, then the older equals filters of RuleCondition.Data as RuleCheckOperator.Eq checks marked RuleCheck.IsLegacy. The engine, the validation, the texts and the rule dialog read checks only through this.

RuleCondition Clone()

A copy.