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. Think of it like a building blueprint. The blueprint (domain model) specifies which rooms exist, how they connect, and what each room contains. The construction crew (Powersheet runtime) reads the blueprint and builds everything accordingly. If you want to add a new room, you update the blueprint rather than writing new construction instructions from scratch.The three configuration layers
Powersheet’s model-driven architecture rests on three distinct configuration layers that work together. Understanding how they connect is essential for building effective sheets.| Layer | File | Purpose |
|---|---|---|
| Domain model | model.yaml | Defines entity types, properties, and relationships |
| Sheet configuration | powersheet.yaml | Defines columns, views, formatters, and sources |
| Polarion project | Link roles, work item types | Provides the underlying data infrastructure |
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
domainModelTypes (like UserNeed) becomes the entity type name used throughout the rest of the configuration. The polarionType maps it to the corresponding Polarion work item type. Properties listed under properties become available as columns in the sheet.
Relationships and navigation properties
Relationships define how entity types connect to each other. Each relationship specifies:from/to— the source and target entity typescardinality— the multiplicity (many-to-one, one-to-many, many-to-many)storage— how the link is persisted in Polarion (linkedWorkItemsis the only supported storage mechanism)linkRole— the Polarion link role that implements the connectiondirect/back— the navigation property names for forward and reverse traversal
direct.name: userNeeds— navigate from aSystemRequirementto its linkedUserNeeditemsback.name: systemRequirements— navigate from aUserNeedto its linkedSystemRequirementitems
Built-in entity types
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. The sheet configuration handles presentation and interaction. You can pair one domain model with multiple sheet configurations, or update the Polarion mappings without touching the column layout.
How cardinality shapes the sheet
Thecardinality of a relationship determines how data flows through sources, how columns bind to properties, and what users see in the sheet. This is perhaps the most important concept for understanding how model-driven design translates into a working UI.
| Cardinality | Model definition | Source expand | Column binding | UI behavior |
|---|---|---|---|---|
| N:1 | cardinality: many-to-one, direct.name: chapter | - name: chapter | chapter, chapter.title | Single-value reference picker |
| 1:N | Reverse of N:1, back.name: userNeeds | - name: userNeeds | userNeeds | Child rows (new hierarchy level) |
| M:N | cardinality: many-to-many, back.name: systemRequirements | - name: systemRequirements then - name: systemRequirement | systemRequirements.systemRequirement | Multi-item reference picker |
Many-to-one: scalar references
When an entity has a many-to-one relationship (eachUserNeed belongs to exactly one Chapter), the navigation property is scalar. The source expands it with a single name, and columns can either display a picker for the reference or read through to display properties of the referenced entity:
One-to-many: hierarchical expansion
The reverse side of a many-to-one relationship is one-to-many. This is where Powersheet’s hierarchical nature becomes visible. When aChapter expands into its userNeeds, each child UserNeed appears as a nested row under the parent. The expand creates a new level in the sheet hierarchy.
Many-to-many: association entities
Many-to-many relationships use an association entity between the two types. The source expand goes through two levels — first the association collection, then the target entity. The column binding uses dot-notation to reach through:systemRequirements then systemRequirement) and the dot-notation column key (systemRequirements.systemRequirement) are the telltale signs of a many-to-many relationship. When a sheet has two different work item types linked to the same parent entity, the second linked column must declare multiItem: true in the sheet configuration.
Constraints and picker filtering
The domain model also drives picker constraints — rules that filter which items appear when a user selects a related entity. Constraints can restrict picker results by:- Document location (
moduleFolder,moduleName) — limit selections to items in specific spaces - Document type (
type) — only show items from documents of a certain type - Component (
component) — scope selections to the same component as the source entity using$context.source.document.component
SystemRequirement in the sheet, the picker only shows items from documents in the Requirements space that have the requirements_specification document type. The runtime applies these filters automatically based on the model declaration.
Dynamic context references like
$context.source.document.component resolve at runtime based on the current entity’s document context. The exact behavior depends on the project’s component configuration in Polarion.Why model-driven design matters
The model-driven approach delivers several practical benefits that become increasingly valuable as configurations grow in complexity: Consistency across the organization. Because the domain model is a single YAML file shared across sheet configurations, all sheets that reference the same model use identical entity definitions, relationship rules, and navigation properties. Changes propagate automatically. Separation of concerns. Polarion administrators manage work item types and link roles. Domain model authors map those to a clean entity vocabulary. Sheet designers compose columns and views without worrying about Polarion internals. Each role works at the appropriate level of abstraction. Reduced configuration errors. New users frequently encounter issues when jumping straight to complex multi-entity configurations. The model-driven pattern encourages an incremental approach: define one entity type, verify it works, then add relationships one at a time. Each addition is a self-contained YAML block that can be validated independently. Reusability across projects. A well-designed domain model can serve multiple Polarion projects by updating only thepolarionType and linkRole mappings. The sheet configurations, sources, and column bindings remain unchanged because they reference entity type names and navigation properties, not Polarion-specific identifiers.
For a detailed comparison of the domain model and sheet configuration files, see Data Model vs Sheet Configuration. To understand how entity types and relationships are structured in practice, see Entity Types and Relationships. For hands-on configuration guidance, see the Data Model Guides.
Sources
Sources
Source Code: DomainModelV2.java, Relationship.java, Direction.java, whole_rtm.template.yamlTickets: Configuration setup guidance, domain model configuration support, multi-item column setup