Skip to main content

Why Document Rules Exist

Siemens Polarion ALM organizes work items inside LiveDoc documents, but it does not natively enforce which work item types belong in which documents. A systemRequirement 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 can lead to audit findings and traceability gaps. Document rules in the domain model act as process guardrails. They do not change Polarion’s underlying storage — they control what Powersheet loads, displays, and permits through the sheet interface.

How Document Rules Work

Document rules are expressed as constraints on entity types within the domain model YAML. Each constraint type — load, create, and pick — can include a document object that filters based on document properties. diagram

Document Properties in Constraints

All constraint types support the same set of document filter properties:
PropertyDescriptionExample
document.moduleFolderRestricts to a specific Polarion module folder (space)Requirements
document.moduleNameRestricts to a specific document by exact nameSystem Specification
document.typeRestricts to a specific Polarion document typesystemSpecification
document.componentRestricts by component; supports $context expressions$context.source.document.component

Load Rules

A load constraint with document rules ensures that only work items from matching documents are displayed in the sheet:
domainModelTypes:
  SystemRequirement:
    polarionType: systemRequirement
    constraints:
      load:
        document:
          type: systemSpecification
This means the sheet query will only return SystemRequirement items that reside in documents whose type is systemSpecification.

Create Rules

Create constraints determine the default document location when a user creates a new entity through the sheet:
domainModelTypes:
  DesignRequirement:
    polarionType: designOutput
    constraints:
      create:
        document:
          moduleFolder: Design
          moduleName: Design Specification
When a user creates a new DesignRequirement item, Powersheet automatically places it in the Design Specification document within the Design folder.

Pick Rules

Pick constraints scope the item picker to only show items from matching documents:
domainModelTypes:
  UserNeed:
    polarionType: userNeed
    constraints:
      pick:
        document:
          moduleFolder: Requirements
          type: needsDocument
When another entity type references UserNeed through a relationship, the picker dialog will only show user needs from needsDocument-type documents in the Requirements folder.

Dynamic Document Scoping with Context

For projects where document assignments vary by component or context, document rules support $context expressions. The most common pattern scopes the picker to the same component as the source entity:
constraints:
  pick:
    document:
      component: $context.source.document.component
This ensures that when picking related items, only entities from documents with the same component value are shown — useful in multi-component projects where each component has its own requirement and design documents.
You can define load, create, and pick constraints on the same entity type to enforce different rules at each lifecycle stage. For example, load broadly from all specification documents, but restrict creation to a single default document.

Relationship to Other Concepts

Document rules work alongside Link Cardinality and Process Constraints to create a complete enforcement model. Cardinality controls how many links are allowed; document rules control where entities can exist and be selected. For hands-on setup, see Creating Your First Data Model.
KB ArticlesSource Code
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/models/constraints-base.yaml
  • model.yaml
  • prod-powersheet-src/com.nextedy.powersheet.client/src/modules/ConfigProvider/types/PowersheetConfig.d.ts
  • PolarionQueryProcessor.java
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/models/permissions.yaml