Why Constraints Exist
Imagine a warehouse where any box can be placed on any shelf. That is how Polarion’s native data model works: any work item can link to any other work item, reside in any document, and be created anywhere. This flexibility is powerful but can lead to structural chaos in regulated environments where requirements must live in specific documents, risks must trace to specific controls, and design outputs must stay within their designated spaces. Process constraints in Powersheet act as guardrails: they do not change what Polarion can store, but they control what Powersheet will display, allow users to pick, and where it permits new items to be created.The Three Constraint Types
The domain model supports three categories of constraints, each operating at a different point in the data lifecycle:Load Constraints
constraints.load filters which entities are retrieved when the sheet initially queries Polarion. This operates at the query level, reducing the result set before data reaches the client.
A load constraint typically uses document properties to scope the data:
systemSpecification appear in the sheet.
Create Constraints
constraints.create controls where new work items are placed when users create them through the sheet. By specifying a document constraint with moduleFolder, moduleName, or type, you route new items to the correct document automatically.
Pick Constraints
constraints.pick restricts which existing items appear in picker dialogs when users create relationships. This is critical for preventing incorrect traceability links.
Document-Based Constraint Properties
All three constraint types share a common set of document-based filter properties:| Property | Description |
|---|---|
document.moduleFolder | Restricts to a specific Polarion module folder (space) |
document.moduleName | Restricts to a specific document by exact name |
document.type | Restricts to documents of a specific Polarion document type |
document.component | Restricts by document component; supports $context references |
Dynamic Context References
Constraints support runtime context expressions using the$context prefix. The most common pattern is $context.source.document.component, which dynamically resolves to the component of the source entity’s document:
The exact set of
$context expressions available may vary by version. Test context-based constraints in your environment to confirm behavior.How Constraints Relate to Other Concepts
Constraints work in concert with Link Cardinality and Document Rules to enforce your engineering process. While cardinality controls how many links are allowed, constraints control which items are visible, selectable, and creatable. For practical setup guidance, see Creating Your First Data Model.Sources
Sources
Source Code
todos_model.yamltodosBig_model.yamlmodel.yamlprod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/models/constraints-base.yamlDatabridgeMetadata.java