diff --git a/src/ZB.MOM.WW.MxGateway.Worker.Tests/MxAccess/SubtagAlarmConsumerTests.cs b/src/ZB.MOM.WW.MxGateway.Worker.Tests/MxAccess/SubtagAlarmConsumerTests.cs index aa74ffd..572aec3 100644 --- a/src/ZB.MOM.WW.MxGateway.Worker.Tests/MxAccess/SubtagAlarmConsumerTests.cs +++ b/src/ZB.MOM.WW.MxGateway.Worker.Tests/MxAccess/SubtagAlarmConsumerTests.cs @@ -40,9 +40,9 @@ public sealed class SubtagAlarmConsumerTests return new SubtagAlarmConsumer(source, new[] { BuildTarget() }); } - /// Verifies Subscribe advises the active, acked, and priority subtags but not the ack-comment subtag. + /// Verifies Subscribe advises the active, acked, priority, and ack-comment subtags (the ack-comment is advised so it is an active, writable MXAccess item). [Fact] - public void Subscribe_AdvisesActiveAndAckedSubtags() + public void Subscribe_AdvisesAllSubtagsIncludingAckComment() { FakeSource source = new FakeSource(); using SubtagAlarmConsumer consumer = BuildConsumer(source); @@ -52,7 +52,7 @@ public sealed class SubtagAlarmConsumerTests Assert.Contains(ActiveSubtag, source.Advised); Assert.Contains(AckedSubtag, source.Advised); Assert.Contains(PrioritySubtag, source.Advised); - Assert.DoesNotContain(AckCommentSubtag, source.Advised); + Assert.Contains(AckCommentSubtag, source.Advised); } /// Verifies an active=true value change raises a degraded, GUID-stamped UNACK_ALM transition. diff --git a/src/ZB.MOM.WW.MxGateway.Worker/MxAccess/SubtagAlarmConsumer.cs b/src/ZB.MOM.WW.MxGateway.Worker/MxAccess/SubtagAlarmConsumer.cs index 222b737..87b0c2f 100644 --- a/src/ZB.MOM.WW.MxGateway.Worker/MxAccess/SubtagAlarmConsumer.cs +++ b/src/ZB.MOM.WW.MxGateway.Worker/MxAccess/SubtagAlarmConsumer.cs @@ -78,10 +78,15 @@ public sealed class SubtagAlarmConsumer : IMxAccessAlarmConsumer } /// - /// Advises every observable alarm subtag (active / acked / priority — - /// the ack-comment subtag is a write-only target and is not advised) - /// and begins listening for value changes. The - /// expression is ignored: the subtag set is fixed by the watch list. + /// Advises every alarm subtag (active / acked / priority, plus the + /// ack-comment subtag) and begins listening for value changes. The + /// ack-comment subtag is advised so it is an active MXAccess item by the + /// time writes it — MXAccess rejects a + /// write to an added-but-not-advised item with E_INVALIDARG (confirmed + /// against live MXAccess). Its value changes carry no transition (the + /// state machine ignores addresses it does not map to active/acked). + /// The expression is ignored: the subtag + /// set is fixed by the watch list. /// /// The subscription expression (unused in subtag mode). public void Subscribe(string subscription) @@ -97,6 +102,7 @@ public sealed class SubtagAlarmConsumer : IMxAccessAlarmConsumer AddIfNotEmpty(addresses, target.ActiveSubtag); AddIfNotEmpty(addresses, target.AckedSubtag); AddIfNotEmpty(addresses, target.PrioritySubtag); + AddIfNotEmpty(addresses, target.AckCommentSubtag); } source.Advise(addresses);