Why Constraints Exist
Consider a regulated engineering environment: user needs must live in a stakeholder requirements document, system requirements belong in a system specification, and design outputs go into a design document. Polarion itself does not enforce these structural rules — it stores the data, but it does not prevent a user from placing a system requirement in the wrong document or linking a hazard to an unrelated test case. Process constraints in Powersheet act as guardrails: they do not alter what Polarion can store, but they control what Powersheet will display in the sheet, offer in picker dialogs, and permit as a target location when creating new items. Think of constraints as a building’s access control system. The building itself (Polarion) has rooms and hallways connecting them, but the access system (constraints) determines which doors open for which people and which rooms are available for new meetings. The physical structure is unchanged, but the behavior is governed.The Three Constraint Stages
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 ever reaches the client application.
A load constraint typically uses document properties to scope entity retrieval:
systemSpecification are loaded into the sheet. Items in other document types are invisible to Powersheet, as though they do not exist.
Pick Constraints
constraints.pick restricts which existing items appear in picker dialogs when users create or modify relationships. This is critical for preventing incorrect traceability links — without pick constraints, a user could link a system requirement to an item from an unrelated document or project space.
UserNeed, only items from the Requirements folder in documents of type needsDocument appear as candidates.
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 location automatically.
DesignRequirement through the sheet, Powersheet automatically places it in a document matching the Design folder and designSpecification type. The user does not need to manually choose a target location.
Stage Cascading and Fallback
One of the most important aspects of the constraint system is stage cascading. The three stages form an inheritance chain:loadis the base stage — it stands alone with no inheritancepickinherits allloadconstraints (combined with AND logic)createinherits bothloadandpickconstraints
load constraint automatically scopes all three user interactions. If you constrain load to filter by document.type: systemSpecification, then the picker and create dialogs also respect that filter without requiring explicit pick or create blocks.
Practical implication: Start with the most restrictive stage you need. If a load constraint covers your needs, you may not need pick or create blocks at all. Add them only when the three stages require different scoping rules.
| Scenario | Minimum constraints needed |
|---|---|
| Same filter for all interactions | load only |
| Different picker scope than loaded data | load + pick |
| Create targets a specific document | load + create (or load + pick + create) |
| Each stage has unique rules | All three explicitly defined |
Document-Based Constraint Properties
All three constraint stages share a common set of document-level filter properties:| Property | Description | Example value |
|---|---|---|
document.moduleFolder | Restricts to a specific Polarion module folder (space) | Requirements |
document.moduleName | Restricts to a specific document by exact name | System Specification |
document.type | Restricts to documents of a specific Polarion document type | systemSpecification |
document.id | Restricts by full document ID in folder/name format | Requirements/Stakeholder Needs |
document.title | Restricts by document display title | Stakeholder Requirements |
document.component | Restricts by document component; supports $context references | $context.source.document.component |
Comparison Operators
Constraint values are not limited to exact matching. Powersheet provides five comparison operators that give you flexible filtering patterns:| Operator | Meaning | Example |
|---|---|---|
equals | Exact match (default when no operator specified) | type: systemSpecification |
contains | Value contains the substring | moduleName: {contains: "Spec"} |
in | Value matches any item in a list | type: {in: [systemSpec, designSpec]} |
startsWith | Value starts with the prefix | moduleFolder: {startsWith: "Req"} |
endsWith | Value ends with the suffix | moduleName: {endsWith: "Document"} |
type: systemSpecification), it is interpreted as an equals comparison. Use the object syntax with an explicit operator key when you need other matching behavior.
Logical Operators: AND and OR
By default, multiple properties within adocument block are combined with AND logic — all conditions must be true for an item to match.
Requirements folder AND in a document of type needsDocument.
Powersheet also supports OR logic inside the document block, allowing you to match items that satisfy any one of several conditions. This is useful when valid items can come from multiple document types or folders.
When combining multiple constraints with OR logic, be careful about conflicting conditions. Two constraints that individually match different sets of items may produce an empty result if their intersection is empty. Test complex constraint compositions in a development environment before deploying to production.
Dynamic Context References
Constraints support runtime context expressions using the$context prefix. These expressions are resolved dynamically when the constraint is evaluated, allowing the filter to adapt based on the current document or entity.
The most common pattern is component-scoped filtering:
| Expression | Resolves to |
|---|---|
$context.source.document.component | Component of the source entity’s parent document |
$context.document.id | Full ID of the current document |
The exact set of
$context expressions available may vary by Powersheet version. Test context-based constraints in your environment to confirm behavior before relying on them in production configurations.Constraint Composition: A Complete Example
The following domain model excerpt shows constraints applied to a standard RTM hierarchy. Each entity type is scoped to its correct document location, with pick constraints ensuring traceability links stay within the proper boundaries:UserNeeditems are loaded only from stakeholder requirements documents, and pickers further restrict to theRequirementsfolderSystemRequirementitems load from system specifications, and new items are created in theDesignfolder within system specification documentsDesignRequirementfollows a similar pattern, scoped to design specificationsHazardpick constraints ensure risk-related linking stays within the same component, enforcing component-level traceability
How Constraints Relate to Other Concepts
Constraints work in concert with several other domain model concepts to enforce your engineering process:- Link Cardinality controls how many links are allowed between entity types, while constraints control which items are visible, selectable, and creatable
- Document Rules define broader document-level governance that applies regardless of entity type
- Entity Types and Relationships define the structural connections that constraints then filter and scope
- Navigation Properties use the
directandbackdirections that constraints influence when loading related entities
Common Misconceptions
“Constraints block Polarion from storing data.” They do not. Constraints operate at the Powersheet application layer. A user with direct Polarion access or another tool can still create items outside the constraint boundaries. Constraints govern the Powersheet experience, not the underlying Polarion data store. “I need all three stages defined for every entity type.” In most cases, you only needload constraints. Thanks to cascading, pick inherits from load and create inherits from both. Define additional stages only when their scoping rules differ from the inherited behavior.
“OR logic means I can match anything.” While OR broadens the filter, all constraints within a stage are still composed together. Two OR branches with contradictory conditions can still produce an empty result set. Always verify composed constraints against real data.
For practical guidance on implementing constraints in your domain model, see Creating Your First Data Model and the Data Model Guides.
Sources
Sources
KB ArticlesSupport TicketsSource Code
DomainModelV2.javaEntityTypeFactory.javawhole_rtm.template.yaml