Why Document Rules Matter
Siemens Polarion ALM organizes work items inside LiveDoc documents, but it does not natively restrict which work item types belong in which documents. AsystemRequirement work item can be created in any document, and a userNeed can end up in a design specification. In regulated industries following standards like ISO 26262 or Automotive SPICE, this structural freedom introduces risk: auditors expect clear separation between requirement types, and traceability gaps emerge when items scatter across uncontrolled locations.
Document rules in the domain model act as process guardrails. They do not alter Polarion’s underlying data storage — they control what Powersheet queries, displays, and permits through the sheet interface. This distinction is important: a SystemRequirement work item that exists in an unexpected document is not deleted or moved by a document rule. Instead, the rule simply prevents it from appearing in the sheet, being selected in a picker, or being the default location for new items of that type.
Document rules are defined per entity type in the domain model YAML (
domainModelTypes), not in the sheet configuration. This means they apply consistently across every sheet configuration that uses the same domain model, regardless of column layout or view settings.The Three Constraint Stages
Document rules operate through three constraint stages, each controlling a different aspect of how entities interact with documents. These stages are defined within theconstraints block on an entity type.
Stage Cascading
A critical concept is that constraint stages cascade upward:pickinherits fromload. If you defineloadconstraints but nopickconstraints, the pick stage uses the load constraints automatically.createinherits from bothloadandpick. If no explicitcreateconstraints exist, the system falls back topickconstraints (which themselves may have fallen back toload).
load stage. The pick and create stages will inherit its document rules unless you need different behavior at those stages.
Load Stage
Aload constraint with document rules filters the initial data query so that only work items residing in matching documents appear in the sheet:
SystemRequirement items from documents whose type is systemSpecification. Items of the same Polarion work item type in other documents are excluded from the display.
Pick Stage
Pick constraints scope the item picker dialog. When a user links a relationship to aUserNeed, the picker shows only items matching the pick constraints:
UserNeed through a relationship, the picker dialog will only show user needs from needsDocument-type documents in the Requirements folder. This prevents users from accidentally linking to items in unrelated documents.
Create Stage
Create constraints determine the default document location when a user creates a new entity through the sheet:DesignRequirement item, Powersheet automatically places it in the Design Specification document within the Design folder. Without this constraint, new items might be created in the currently active document, which may not be the intended location.
Document Filter Properties
All three constraint stages support the same set of document filter properties within thedocument block:
| Property | What It Filters | Example Value |
|---|---|---|
document.moduleFolder | Restricts to work items within a specific Polarion module folder (space) | Requirements |
document.moduleName | Restricts to work items within a specific document by exact name match | System Specification |
document.type | Restricts to work items in documents of a specific Polarion document type | systemSpecification |
document.component | Restricts by the document’s component property; supports dynamic $context expressions | $context.source.document.component |
document block. When multiple properties are specified, they act as an AND condition — all criteria must match for a document to qualify.
systemSpecification-type documents from the Requirements folder that belong to the Braking component.
Dynamic Document Scoping with Context
For projects where document assignments vary by component, subsystem, or other runtime context, document rules support$context expressions. These expressions resolve dynamically based on the current document, source entity, or query parameters rather than being hardcoded in the domain model.
The most common pattern scopes constraints to the same component as the source entity’s document:
$context expressions at runtime by injecting the current document’s properties (such as document.id, document.moduleFolder, and document.component) into the query parameters. This resolution happens transparently before the query is sent to the server.
Combining Document Rules Across Entity Types
In a full RTM domain model, each entity type typically has its own document rules. Consider a standard requirements traceability hierarchy:DesignRequirement type adds an explicit create stage to control where new items land. The Hazard type uses dynamic component scoping for its picker.
Comparison Operators in Constraints
Beyond simple equality matching, constraints support several comparison operators that provide more flexible filtering:| Operator | Behavior | Example |
|---|---|---|
equals | Exact match (default when no operator specified) | type: systemSpecification |
contains | Substring match | moduleName: { contains: "Spec" } |
in | Matches any value in a list | type: { in: [sysSpec, designSpec] } |
startsWith | Prefix match | moduleFolder: { startsWith: "Req" } |
endsWith | Suffix match | moduleName: { endsWith: "Document" } |
Logical Operators
Within thedocument block, constraints support OR logic for combining alternative conditions. Multiple criteria at the same level are joined with AND logic by default. To express OR conditions, the constraint system allows alternative document blocks:
document block are evaluated as AND. If no create constraints are defined, the system falls back to pick constraints for the create stage, ensuring consistent behavior without redundant configuration.
Common Misconceptions
“Document rules move work items between documents.” They do not. Document rules only affect what Powersheet loads, displays in pickers, and uses as the target for new items. A work item’s actual document location in Polarion is unchanged by document rules. “I need to define all three stages.” Due to cascading inheritance, defining only theload stage is often sufficient. The pick and create stages inherit from it automatically. Define separate stages only when you need different behavior — for example, loading broadly but creating in a specific document.
“Document rules replace Polarion permissions.”
Document rules are a domain model concern, not a security mechanism. They guide the sheet interface but do not override Polarion’s native permission model. A user with Polarion permissions to edit a document outside the constraint scope could still modify items through Polarion’s standard interface, just not through Powersheet.
Relationship to Other Concepts
Document rules are one layer of the broader constraint system in Powersheet. They work alongside other concepts to create a complete enforcement model:- Process Constraints define validation rules beyond document scoping, such as field-level restrictions and workflow enforcement.
- Link Cardinality controls how many relationships of a given type are permitted — while document rules control where the related entities can come from.
- Entity Types and Relationships define the structural foundation that document rules operate upon.
- Navigation Properties determine how relationships are traversed; document rules determine which items are reachable during that traversal.
Sources
Sources
Tickets
- Constraints KB article creation (ticket covering constraint stages, cascading, comparison operators)
- Data model configuration guidance requests
PowersheetDocumentConfigurationService.javaQueryManager.tsxDomainModelV2.javaEntityTypeFactory.java