The design principle
In a model-driven system, configuration files describe what should happen, not how it should happen. The domain model declares entity types, their properties, and their relationships. The Powersheet runtime reads this declaration and automatically generates the metadata, queries, pickers, and validation rules needed to render and edit the data. This is the opposite of a code-driven approach where each new entity type or relationship would require custom development. With Powersheet, adding a new entity type is a YAML change, not a code change.From YAML to metadata
When a powersheet document is opened, the domain model YAML is processed through a metadata generation pipeline. EachdomainModelTypes entry becomes an entity type with:
- A primary key property (
objectId) - A
polarionTypeproperty linking to the Polarion work item type - Built-in properties:
title,icon, and automatically added document and project navigation properties - Custom properties from the
propertiessection, each mapped to Polarion work item fields
relationships section is similarly processed. Each relationship creates navigation properties on both the source and target entity types (using fromNavPropName and toNavPropName), enables expansion paths for loading related data, and establishes the link to a Polarion link role for persistence.
Two built-in entity types are always available regardless of the domain model configuration:
| Entity type | Purpose |
|---|---|
Document | Represents Polarion modules (LiveDocs). Exposes properties like moduleName, moduleFolder, title, and allowedWITypes |
Project | Represents Polarion projects. Automatically linked to all work item entity types |
The mapping layer
A key advantage of model-driven design is that the domain model acts as a mapping layer between Polarion’s native data structures and the Powersheet view. This is significant because:- Different projects can have different Polarion type names for the same conceptual entity. The domain model normalizes these: one project’s
sys_requirementand another’ssystemReqcan both map to aSystemRequiremententity type in the domain model. - Link roles vary between projects. The domain model abstracts them behind navigation property names, so the sheet configuration remains identical.
- A single sheet configuration can be reused across projects that share the same domain model structure but differ in Polarion-level details.
This mapping layer is why the domain model and sheet configuration are separate files. The domain model handles project-specific Polarion mappings, while the sheet configuration handles presentation concerns. Changing one does not require changing the other.
Constraints as declarations
Beyond entity types and relationships, the domain model supports declarative constraints that control runtime behavior:loadconstraints: filter which entities are loaded from the query (e.g., load only work items from documents of a specific type)createconstraints: set default values for newly created entities (e.g., automatically assign to a specific document based on context)pickconstraints: filter which entities appear in selection pickers (e.g., show onlySystemRequirementitems from documents matching the source entity’s component)
$context.source.document.component to resolve values at runtime based on the current user’s context. This enables sophisticated data routing without custom code.
Properties and permissions
The domain model also controls property-level permissions throughreadable and updatable flags on each property. When readable is set to false, the property is hidden in the sheet. When updatable is false, the property is displayed but cannot be edited.
These permissions intersect with Polarion’s native security model. A user must have both the domain model permission and the Polarion field-level permission to edit a property.
The exact interaction between domain model permissions and Polarion security depends on the server configuration. The domain model can only restrict access further — it cannot grant permissions beyond what Polarion allows.
Practical implications
The model-driven approach has several practical consequences for administrators:- All customization happens in YAML files — no code changes, no deployments, no server restarts
- Changes are versioned in Polarion’s SVN repository — configuration history is preserved and auditable
- Domain models can be shared globally — define once, use across multiple projects
- Errors are configuration errors, not code errors — debugging means checking YAML syntax and property references
Sources
Sources
Source Code
model.yamltodosBig_model.yamlprod-powersheet-src/com.nextedy.powersheet.client/cypress/e2e/admin/admin.cy.tsprod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/models/constraints-base.yamlrtm_model.yaml