From 9bf854e791aa454e2f101dff45b5cdcfa0e49ab6 Mon Sep 17 00:00:00 2001 From: Lukasz Zoladkiewicz Date: Fri, 22 May 2026 14:17:15 +0200 Subject: [PATCH] feat(maintain): Add Gridzone data and references. --- modules/solutions/cdm_maintain/README.md | 12 +-- .../SourceMaintenanceOrder.Container.yaml | 15 ++++ .../views/SourceMaintenanceOrder.View.yaml | 24 ++++++ .../data_modeling/nodes/activities.Node.yaml | 6 ++ .../nodes/gridZoneAnnotations.Node.yaml | 76 +++++++++++++++++++ .../cdf_sample_data/default.config.yaml | 4 + 6 files changed, 131 insertions(+), 6 deletions(-) create mode 100644 modules/solutions/cdm_maintain/cdf_sample_data/data_modeling/nodes/gridZoneAnnotations.Node.yaml diff --git a/modules/solutions/cdm_maintain/README.md b/modules/solutions/cdm_maintain/README.md index e0fe3805..8167c574 100644 --- a/modules/solutions/cdm_maintain/README.md +++ b/modules/solutions/cdm_maintain/README.md @@ -77,7 +77,7 @@ cdm_maintain/ ├── 📄 module.toml ├── 📄 default.config.yaml ├── 📁 data_modeling/ - │ └── 📁 nodes/ # Sample maintenance records + │ └── 📁 nodes/ # Sample maintenance records and grid zone annotations └── 📁 upload_data/ # Files uploaded via `cdf data upload` command ├── 📄 *.Manifest.yaml # Upload manifests └── 📁 files/ # Sample attachments @@ -112,6 +112,7 @@ Template for integrating source system data: ### 5. Sample Data Ready-to-load sample records to validate your setup: - **Sample activities and assets** +- **Grid zone annotations** (`gridZoneAnnotations.Node.yaml`) — maps zones on the sample P&ID to activities via `rootLocation` and `gridReference` - **Test documents and attachments** (uploaded via `cdf data upload` command, manifests in `upload_data/`) ## 🔧 Configuration @@ -130,7 +131,9 @@ Each module's `default.config.yaml` declares the variables used by that module. | `cdf_maintain_location` | `appDataSpace` | `maintain_solution_model` | Solution model space (cross-module ref) | | `cdf_maintain_location` | `sourceDataSpace` | `maintain_source_data` | Source data space (cross-module ref) | | `cdf_sample_data` | `instanceSpace` | `maintain_source_data` | Space where sample instances are written | +| `cdf_sample_data` | `appDataSpace` | `maintain_solution_model` | Space for grid zone annotation nodes (must match `cdf_maintain_location`) | | `cdf_sample_data` | `location` | *(required)* | Root asset externalId prefix (must match `cdf_maintain_location`) | +| `cdf_sample_data` | `location_name` | *(required)* | Human-readable location name used in gridzone and activity data (must match `cdf_maintain_location`) | ## 🏃‍♂️ Getting Started @@ -141,11 +144,6 @@ Each module's `default.config.yaml` declares the variables used by that module. - Data model deployment - Instance creation - File uploads (for sample data) -- `data` plugin enabled in `cdf.toml` (required for `cdf data upload` to upload sample files): - ```toml - [plugins] - data = true - ``` ### 2. Configure the Package @@ -166,7 +164,9 @@ variables: sourceDataSpace: maintain_source_data cdf_sample_data: instanceSpace: maintain_source_data + appDataSpace: maintain_solution_model location: + location_name: ``` ### 3. Add and deploy the package diff --git a/modules/solutions/cdm_maintain/cdf_maintain_source_data_model/data_modeling/containers/SourceMaintenanceOrder.Container.yaml b/modules/solutions/cdm_maintain/cdf_maintain_source_data_model/data_modeling/containers/SourceMaintenanceOrder.Container.yaml index e974312e..c429fb85 100644 --- a/modules/solutions/cdm_maintain/cdf_maintain_source_data_model/data_modeling/containers/SourceMaintenanceOrder.Container.yaml +++ b/modules/solutions/cdm_maintain/cdf_maintain_source_data_model/data_modeling/containers/SourceMaintenanceOrder.Container.yaml @@ -63,10 +63,25 @@ properties: type: direct list: true nullable: true + isInApp: + type: + type: boolean + list: false + nullable: true sourceId: type: type: text list: false nullable: true + rootLocation: + type: + type: text + list: false + nullable: true + gridReference: + type: + type: text + list: false + nullable: true constraints: {} indexes: {} diff --git a/modules/solutions/cdm_maintain/cdf_maintain_source_data_model/data_modeling/views/SourceMaintenanceOrder.View.yaml b/modules/solutions/cdm_maintain/cdf_maintain_source_data_model/data_modeling/views/SourceMaintenanceOrder.View.yaml index 162b0d3d..e31e2f05 100644 --- a/modules/solutions/cdm_maintain/cdf_maintain_source_data_model/data_modeling/views/SourceMaintenanceOrder.View.yaml +++ b/modules/solutions/cdm_maintain/cdf_maintain_source_data_model/data_modeling/views/SourceMaintenanceOrder.View.yaml @@ -106,3 +106,27 @@ properties: containerPropertyIdentifier: sourceId name: sourceId description: Unique identifier matching the externalId, used for activity lookup by the app + isInApp: + container: + type: container + space: {{schemaSpace}} + externalId: SourceMaintenanceOrder + containerPropertyIdentifier: isInApp + name: isInApp + description: Whether the activity should be shown in the app + rootLocation: + container: + type: container + space: {{schemaSpace}} + externalId: SourceMaintenanceOrder + containerPropertyIdentifier: rootLocation + name: rootLocation + description: Root location this activity belongs to, used for gridzone filtering + gridReference: + container: + type: container + space: {{schemaSpace}} + externalId: SourceMaintenanceOrder + containerPropertyIdentifier: gridReference + name: gridReference + description: Grid zone identifier this activity is mapped to (matches the zone property on FileGridZoneAnnotation) diff --git a/modules/solutions/cdm_maintain/cdf_sample_data/data_modeling/nodes/activities.Node.yaml b/modules/solutions/cdm_maintain/cdf_sample_data/data_modeling/nodes/activities.Node.yaml index 62ee2abd..308adecc 100644 --- a/modules/solutions/cdm_maintain/cdf_sample_data/data_modeling/nodes/activities.Node.yaml +++ b/modules/solutions/cdm_maintain/cdf_sample_data/data_modeling/nodes/activities.Node.yaml @@ -35,6 +35,9 @@ isActive: "true" isCompleted: "false" isCancelled: "false" + isInApp: true + rootLocation: "{{location_name}}" + gridReference: "DEMO Grid-1" files: - space: {{instanceSpace}} externalId: DEMO-FILE @@ -76,6 +79,9 @@ isActive: "true" isCompleted: "false" isCancelled: "false" + isInApp: true + rootLocation: "{{location_name}}" + gridReference: "DEMO Grid-2" files: - space: {{instanceSpace}} externalId: DEMO-FILE diff --git a/modules/solutions/cdm_maintain/cdf_sample_data/data_modeling/nodes/gridZoneAnnotations.Node.yaml b/modules/solutions/cdm_maintain/cdf_sample_data/data_modeling/nodes/gridZoneAnnotations.Node.yaml new file mode 100644 index 00000000..127bcc6d --- /dev/null +++ b/modules/solutions/cdm_maintain/cdf_sample_data/data_modeling/nodes/gridZoneAnnotations.Node.yaml @@ -0,0 +1,76 @@ +# Grid Zone Annotations for DEMO-FILE.pdf +# Nodes live in {{appDataSpace}} (appDataInstanceSpace) +# rootLocation must match the rootLocation set on activity nodes ({{location_name}}) +# zone values must match the gridReference set on activity nodes + +# Zone 1 — upper-left quadrant +- space: {{appDataSpace}} + externalId: "{{location}}_gridzone_demo_grid1" + sources: + - source: + type: view + space: {{appDataSpace}} + externalId: FileGridZoneAnnotation + version: v1 + properties: + fileReference: "DEMO-FILE" + rootLocation: "{{location_name}}" + zone: "DEMO Grid-1" + x1: 0.0 + x2: 0.5 + y1: 0.0 + y2: 0.5 + +# Zone 2 — upper-right quadrant +- space: {{appDataSpace}} + externalId: "{{location}}_gridzone_demo_grid2" + sources: + - source: + type: view + space: {{appDataSpace}} + externalId: FileGridZoneAnnotation + version: v1 + properties: + fileReference: "DEMO-FILE" + rootLocation: "{{location_name}}" + zone: "DEMO Grid-2" + x1: 0.5 + x2: 1.0 + y1: 0.0 + y2: 0.5 + +# Zone 3 — lower-left quadrant +- space: {{appDataSpace}} + externalId: "{{location}}_gridzone_demo_grid3" + sources: + - source: + type: view + space: {{appDataSpace}} + externalId: FileGridZoneAnnotation + version: v1 + properties: + fileReference: "DEMO-FILE" + rootLocation: "{{location_name}}" + zone: "DEMO Grid-3" + x1: 0.0 + x2: 0.5 + y1: 0.5 + y2: 1.0 + +# Zone 4 — lower-right quadrant +- space: {{appDataSpace}} + externalId: "{{location}}_gridzone_demo_grid4" + sources: + - source: + type: view + space: {{appDataSpace}} + externalId: FileGridZoneAnnotation + version: v1 + properties: + fileReference: "DEMO-FILE" + rootLocation: "{{location_name}}" + zone: "DEMO Grid-4" + x1: 0.5 + x2: 1.0 + y1: 0.5 + y2: 1.0 diff --git a/modules/solutions/cdm_maintain/cdf_sample_data/default.config.yaml b/modules/solutions/cdm_maintain/cdf_sample_data/default.config.yaml index 4bc1c084..a9cf2f75 100644 --- a/modules/solutions/cdm_maintain/cdf_sample_data/default.config.yaml +++ b/modules/solutions/cdm_maintain/cdf_sample_data/default.config.yaml @@ -1,4 +1,8 @@ # Space where sample data instances are written (must match schemaSpace in cdf_maintain_source_data_model) instanceSpace: maintain_source_data +# Space for solution model data (must match appDataSpace in cdf_maintain_solution_model and cdf_maintain_location) +appDataSpace: maintain_solution_model # Location identifier — must match the location variable in cdf_maintain_location location: +# Human-readable location name — must match location_name in cdf_maintain_location +location_name: