docs(m9): mark M9 delivered + sync TemplateEngine/TreeView/DataConnection/schema-library/CLI docs
- 2026-06-15-stillpending-completion-design.md: M9 section marked DELIVERED with per-feature summary and deferrals (folder drag-drop, unified outbox page). - stillpending.md: T22–T26/T28/T30–T32 + CLI cached-call marked [DELIVERED M9]; permanent deferrals (folder drag-drop, unified outbox page) retained as [PERM]. - Component-TemplateEngine.md: TemplateFolder SortOrder + ReorderTemplateFolderCommand; Expression-trigger analysisKind (Advisory/Strict) on Alarm + Script; Script parameter JSON Schema / lib: ref note; Inheritance Resolve authoring section (GetResolvedTemplateMembersCommand / TemplateInheritanceResolver / staleness banner); updated Responsibilities. - Component-TreeView.md: T22 search box wired note; T23 folder sibling reorder + root context menu note; drag-drop permanently deferred clarified in V7 worked example. - Component-CentralUI.md: template tree search + inherited-members panel (T26 staleness banner) added to Template Authoring; drag-drop permanently deferred note; Schema Library page (T32) added as new subsection; ParameterValueForm + Monaco hover (T30/T31) noted; connection live-status (T25) + move-connection (T24) added to Site & Data Connection Management. - Component-ConfigurationDatabase.md: SharedSchema entity + ISharedSchemaRepository row added. - Component-CLI.md: --trigger-kind option added to template alarm add/update and script add/update. - src/ZB.MOM.WW.ScadaBridge.CLI/README.md: --trigger-kind option added to template alarm add/update and template script add/update command tables (already had cached-call group).
This commit is contained in:
@@ -24,6 +24,7 @@ Central cluster only. Sites receive flattened output and have no awareness of te
|
||||
- Provide on-demand validation for Design users during template authoring.
|
||||
- Enforce template deletion constraints — templates cannot be deleted if any instances or child templates reference them.
|
||||
- Organize templates into nested folders (`TemplateFolder` entity) and validate folder hierarchy invariants (acyclicity, sibling uniqueness, non-empty-on-delete).
|
||||
- Resolve and surface the full multi-level effective inherited member set for a template (read-only authoring view), including origin annotation, locked state, merged trigger config, and a staleness summary comparing the child's effective member set against the base.
|
||||
|
||||
## Key Entities
|
||||
|
||||
@@ -42,6 +43,7 @@ Central cluster only. Sites receive flattened output and have no awareness of te
|
||||
- Folders carry **no semantic meaning** for template resolution, flattening, validation, or inheritance — they exist purely for UI organization.
|
||||
- Folder deletion is blocked if the folder contains any subfolders or templates.
|
||||
- The folder graph is enforced acyclic on move (a folder cannot become its own descendant).
|
||||
- Each folder carries an integer **`SortOrder`** (assigned distinctly on create; default 0) used for sibling reorder. `ReorderTemplateFolderCommand` swaps the `SortOrder` of two adjacent siblings; the UI exposes Move-up / Move-down menu items in the folder context menu. Drag-drop reorganization is deliberately deferred.
|
||||
|
||||
### Attribute
|
||||
- Name, Value, Data Type (Boolean, Integer, Float, String), Lock Flag, Description.
|
||||
@@ -50,8 +52,9 @@ Central cluster only. Sites receive flattened output and have no awareness of te
|
||||
|
||||
### Alarm
|
||||
- Name, Description, Priority Level (0–1000), Lock Flag.
|
||||
- Trigger Definition: Value Match, Range Violation, or Rate of Change.
|
||||
- Trigger Definition: Value Match, Range Violation, Rate of Change, HiLo, or Expression.
|
||||
- Optional On-Trigger Script reference.
|
||||
- Expression triggers carry an **`analysisKind`** field (`Advisory` | `Strict`) in the trigger-config JSON. `Advisory` (default) keeps the current behavior where a blank expression is a non-blocking advisory finding. `Strict` escalates a blank expression to a **deploy-blocking error**. The `analysisKind` is set per-trigger in the UI or via the CLI `--trigger-kind` option.
|
||||
|
||||
### Native Alarm Source (`TemplateNativeAlarmSource`)
|
||||
- A read-only binding that mirrors **native alarms** raised by an upstream system — OPC UA Alarms & Conditions or the MxAccess Gateway — rather than alarms evaluated by the Site Runtime from attribute values.
|
||||
@@ -63,8 +66,9 @@ Central cluster only. Sites receive flattened output and have no awareness of te
|
||||
### Script (Template-Level)
|
||||
- Name, Lock Flag, C# source code.
|
||||
- Trigger configuration: Interval, Value Change, Conditional, Expression, or invoked by alarm/other script. Conditional and Expression triggers also carry a fire mode — **OnTrue** (fire as the condition becomes true) or **WhileTrue** (re-fire on a timer while it stays true).
|
||||
- Expression triggers carry an **`analysisKind`** field (`Advisory` | `Strict`) in the trigger-config JSON, with the same semantics as alarm Expression triggers above.
|
||||
- Optional minimum time between runs — also the re-fire cadence for a WhileTrue trigger.
|
||||
- **Parameter Definition** *(optional)*: Defines input parameters (name and data type per parameter). Scripts without parameters accept no arguments.
|
||||
- **Parameter Definition** *(optional)*: Defines input parameters (name and data type per parameter). Scripts without parameters accept no arguments. Parameters that take a JSON `object` or `list` value may carry a JSON Schema definition (plain schema or `{"$ref":"lib:Name"}` pointing to the schema library) used by the Central UI value-entry form and Monaco hover/completion.
|
||||
- **Return Value Definition** *(optional)*: Defines the structure of the script's return value (field names and data types). Supports single objects and lists of objects. Scripts without a return definition return void.
|
||||
|
||||
### Instance
|
||||
@@ -139,6 +143,19 @@ The `FlatteningService` resolves native alarm sources alongside alarms, emitting
|
||||
- **Composition**: a composed module's sources are path-qualified to the canonical name `[ModuleInstanceName].[Name]`, subject to the same naming-collision checks as other members. Because `SourceReference` is a raw connection address (not an attribute path), composition performs **no attribute-reference rewriting** on it.
|
||||
- **Instance overrides**: `InstanceNativeAlarmSourceOverride` applies its non-null fields (`ConnectionNameOverride`, `SourceReferenceOverride`, `ConditionFilterOverride`) over the inherited/composed result and sets `Source = Override`.
|
||||
|
||||
## Inheritance Resolve — Authoring View
|
||||
|
||||
`GetResolvedTemplateMembersCommand` (handled by `TemplateInheritanceResolver`) returns the **full multi-level effective inherited member set** for a template — the set of members a child template would see if it were the leaf of the inheritance chain. This is a **read-only** query; it does not mutate any template or instance, and it has no effect on the deploy pipeline.
|
||||
|
||||
The resolved result carries, per member:
|
||||
- **Canonical name** and **member kind** (Attribute, Alarm, Script, NativeAlarmSource).
|
||||
- **Origin** — which template in the chain (by name and ID) first defined the member.
|
||||
- **Locked** — whether the member is locked at the level it was last defined, preventing further override.
|
||||
- **Merged HiLo trigger config** — for alarms with a HiLo trigger, the merged setpoint object (base + any intermediate override).
|
||||
- **Staleness summary** — a flag indicating whether the inherited effective value differs from what the requesting template's own copy has stored (i.e., the base has changed since the child was last edited). This drives the read-only "base changed" banner in `TemplateEdit`.
|
||||
|
||||
The resolver is consumed only by the Central UI `TemplateEdit` page. It is not part of the flattening pipeline and is not called during deployment.
|
||||
|
||||
## Diff Calculation
|
||||
|
||||
The Template Engine can compare:
|
||||
|
||||
Reference in New Issue
Block a user