Skip to main content

Step 1: Open the Domain Model

  1. Navigate to Administration > Nextedy POWERSHEET > Domain Models
  2. Select the model you want to edit
  3. Locate the entity type under domainModelTypes where you want to add constraints

Step 2: Understand the Three Constraint Types

Powersheet supports three constraint types, each controlling a different operation:
ConstraintPurposeEffect
loadFilters which entities are visible in the sheetOnly matching entities appear when data loads
createSets defaults for new entitiesNew items are created in the specified location
pickFilters picker dialog optionsOnly matching items appear in relationship pickers
diagram

Step 3: Add Pick Constraints

Pick constraints filter what appears in relationship picker dialogs. Add a constraints block with pick to the entity type:
domainModelTypes:
  SystemRequirement:
    polarionType: systemRequirement
    properties:
      description: ~
      severity: ~
    constraints:
      pick:
        document:
          moduleFolder: Requirements
          type: systemSpecification
This ensures that when a user picks a SystemRequirement through a relationship, only items from the Requirements folder in documents of type systemSpecification are shown.

Step 4: Add Create Constraints

Create constraints specify default document location when new items of this type are created:
domainModelTypes:
  DesignRequirement:
    polarionType: designRequirement
    properties:
      description: ~
    constraints:
      create:
        document:
          moduleFolder: Design
          moduleName: Design Specification
          type: designSpecification

Step 5: Add Load Constraints

Load constraints filter which entities are visible when data loads into the sheet:
domainModelTypes:
  UserNeed:
    polarionType: userNeed
    properties:
      description: ~
    constraints:
      load:
        document:
          type: stakeholderRequirement

Step 6: Use Dynamic Context References

For component-scoped relationships, use $context.source.document.component to dynamically filter based on the source entity’s document:
domainModelTypes:
  SystemRequirement:
    polarionType: systemRequirement
    constraints:
      pick:
        document:
          component: $context.source.document.component
This ensures picker results are scoped to the same component as the parent entity.

Step 7: Apply Constraints on Navigation Properties

Constraints can also be applied to individual relationship directions using the constraints block inside direct or back:
relationships:
  - from: UserNeed
    to: SystemRequirement
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: refines
    direct:
      name: systemRequirements
    back:
      name: userNeeds
      constraints:
        load:
          document:
            component: $context.source.document.component
Use exactly moduleFolder, moduleName, type, and component. Misspelled property names are silently ignored and the constraint will not apply.
Begin with a working model that has no constraints, then add pick constraints first (easiest to test via the picker dialog), followed by create and load constraints.

Available Constraint Properties

PropertyScopeDescription
document.moduleFolderpick, create, loadFilter by Polarion module folder path
document.moduleNamepick, create, loadFilter by exact document name
document.typepick, create, loadFilter by Polarion document type
document.componentpick, create, loadFilter by document component (supports $context)

Verify

After saving the domain model, open a powersheet document that uses this model. You should now see:
  • Pick constraints: Picker dialogs show only items matching the filter criteria
  • Create constraints: New items appear in the specified document location
  • Load constraints: Only matching entities are visible in the sheet
Use the Model Helper widget to visualize the constraint structure.

See Also

constraints-base.yaml, constraints_dynamic_relation.yaml, Constraints.java, model.yaml
KB ArticlesSupport TicketsSource Code
  • model.yaml
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/models/constraints-base.yaml
  • JsonGson.java
  • SchemaGenerator.java
  • Direction.java