namespace ZB.MOM.WW.OtOpcUa.Commons.Messages.Alerts; /// /// Live alarm transition published on the cluster alerts DistributedPubSub topic. /// Emitted by ScriptedAlarmActor (and future native-alarm bridges) when an alarm condition /// transitions; consumed by AlertSignalRBridge for browser fan-out and by historian /// adapters for durable storage. /// /// Stable condition identity (matches ScriptedAlarm.ScriptedAlarmId for scripted alarms). /// UNS path of the Equipment node the alarm hangs under. Doubles as the SourceNode. /// Operator-visible alarm name. /// Activated / Cleared / Acknowledged / Confirmed / Shelved / Unshelved / Disabled / Enabled / CommentAdded. /// 1–1000 numeric severity (OPC UA convention). /// Fully-rendered message text — template tokens already resolved. /// Operator who triggered the transition. "system" for engine-driven events. /// When the transition occurred. /// OPC UA Part 9 condition subtype name — one of LimitAlarm / DiscreteAlarm / OffNormalAlarm / AlarmCondition (the base type, used as the default). The historian feed maps this onto the durable alarm-type column. /// Operator-supplied comment on ack / confirm / comment transitions; null for engine-driven transitions (Activated / Cleared / Shelved / …) that carry no comment. /// When false, the durable historian sink suppresses this transition (the live alerts fan-out is unaffected); null or true historize. null is the cross-version/rolling-restart case: an old-format message missing the field deserializes to null (CLR default for bool?) and is historized (safe default-on), matching the AlarmTypeName null-coalesce in HistorianAdapterActor.Translate. The producer (ScriptedAlarmHostActor) always sets a concrete true/false. /// v3 Batch 4 (multi-notifier native alarms) — the (possibly empty) list of UNS equipment-folder paths (Area/Line/Equipment) that reference the alarm's backing raw tag. A native alarm is a SINGLE Part 9 condition materialised once at the raw tag (its is the RawPath); the same condition fans events to every referencing equipment's UNS folder via SDK notifiers, and this list is carried so /alerts shows the one condition row with all its referencing equipment as display metadata. Empty for scripted alarms (they are per-equipment) and for a native alarm whose raw tag no equipment references. Defaults empty so every existing producer + rolling-restart deserialization keeps compiling / working. public sealed record AlarmTransitionEvent( string AlarmId, string EquipmentPath, string AlarmName, string TransitionKind, int Severity, string Message, string User, DateTime TimestampUtc, string AlarmTypeName = "AlarmCondition", string? Comment = null, bool? HistorizeToAveva = null, IReadOnlyList? ReferencingEquipmentPaths = null);