Task #219 follow-up — close AlarmConditionState child-NodeId + Part 9 event-propagation gaps #198
Reference in New Issue
Block a user
Delete Branch "task-219-followup-alarm-wiring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PR #197 surfaced two integration-level wiring gaps in
DriverNodeManager'sMarkAsAlarmConditionpath. This PR fixes both and upgrades the alarm integration test to assert the full dispatch path end-to-end — no more scope-outs.Fix 1 — addressable child nodes
AlarmConditionStateinherits ~50 typed children (Severity/Message/ActiveState/AckedState/EnabledState/ …). The stack was leaving them with Foundation-namespace NodeIds (type-declaration defaults) or sharedns=0counter allocations, so clientReadon a child returnedBadNodeIdUnknown. PassassignNodeIds=truetoalarm.Create, then walk the condition subtree and rewrite each descendant's NodeId symbolically as{condition-full-ref}.{symbolic-path}in the node manager's namespace. Stable, unique, and collision-free across multiple alarm instances in the same driver.Fix 2 — event propagation to
Server.EventNotifierOPC UA Part 9 event propagation relies on the alarm condition being reachable from
Objects/ServerviaHasNotifier. CallCustomNodeManager2.AddRootNotifier(alarm)after registering the condition so subscriptions placed on Server-objectEventNotifierreceive theReportEventcallsConditionSinkemits per-transition.Test upgrades in
AlarmSubscribeIntegrationTestsDriver_alarm_transition_updates_server_side_AlarmConditionState_node— now assertsSeverity == 700, message text, andActiveState.Id == truethrough the OPC UA client (previously scoped out asBadNodeIdUnknown).Driver_alarm_event_flows_to_client_subscription_on_Server_EventNotifiersubscribes an OPC UA event monitor onObjectIds.Server, fires a driver transition, and waits for theAlarmConditionTypeevent to be delivered — assertingMessage+Severityfields. Previously scoped out as 'Part 9 event propagation out of reach.'Test plan
dotnet test tests/ZB.MOM.WW.OtOpcUa.Server.Tests→ 239 passed, 0 failed (+1 new event-subscription test).dotnet test tests/ZB.MOM.WW.OtOpcUa.Core.Tests→ 195 passed, 0 failed.🤖 Generated with Claude Code