Skip to main content
See also: Relationships | Properties | Binding Syntax

Direction Overview

diagram

Direction Properties

Direct (Forward) Direction

The direct property defines the navigation property created on the source (from) entity type:
NameTypeDefaultDescription
directobjectNoneForward navigation property definition created on the source entity type.
direct.namestringRequiredProperty name for traversing from source to target entities. Used in column bindings and queries.
direct.constraintsobjectNoneOptional constraint configuration for filtering accessible entities through this direction.

Back (Reverse) Direction

The back property defines the navigation property created on the target (to) entity type:
NameTypeDefaultDescription
backobjectNoneReverse navigation property definition created on the target entity type.
back.namestringRequiredProperty name for traversing from target back to source entities. Used in column bindings and queries.
back.constraintsobjectNoneOptional constraint configuration for filtering accessible entities in the reverse direction.

Alternative Naming with fromNavPropName / toNavPropName

An alternative syntax uses flat property names instead of the nested direct/back objects:
NameTypeDefaultDescription
fromNavPropNamestringNoneName of the navigation property added to the from entity type for accessing related to entities. Equivalent to direct.name.
toNavPropNamestringNoneName of the navigation property added to the to entity type for accessing related from entities. Equivalent to back.name.
Use direct/back when you need to attach Constraints to a navigation direction. Use fromNavPropName/toNavPropName for simpler declarations without per-direction constraints.

Nested Direct/Back Syntax

relationships:
  - from: UserNeed
    to: SystemRequirement
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: refines
    direct:
      name: systemRequirements
    back:
      name: userNeeds

Flat Naming Syntax

relationships:
  - from: UserNeed
    to: SystemRequirement
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: refines
    fromNavPropName: systemRequirements
    toNavPropName: userNeeds
Both declarations produce identical navigation properties. The direct/back syntax supports attaching constraints to individual navigation directions, enabling context-aware filtering on expansion paths:
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
In this example, the userNeeds back-navigation property is filtered to only include items from documents with the same component as the source entity’s document.

Using Navigation Properties in Column Bindings

Navigation property names become the segments of dot-separated binding paths in sheet configuration columns:
columns:
  title:
    title: User Need
    width: 200
    hasFocus: true

  systemRequirements.systemRequirement.title:
    title: System Requirement
    width: 200

  systemRequirements.systemRequirement.designRequirements.designRequirement.title:
    title: Design Requirement
    width: 200
The pattern follows: <navigationPropertyName>.<entityTypeName>.<fieldName>.

Expansion Paths and Sources

Navigation property names are also used in the sources expansion configuration to load related entities:
sources:
  - id: requirements
    model: rtm
    query:
      from: UserNeed
    expand:
      - name: systemRequirements
        title: System Requirements
        expand:
          - name: designRequirements
            title: Design Requirements
See Sources for expansion path details.

Property-Level Navigability

The navigability property on data properties controls whether a property can be used for relationship traversal:
ValueDescription
unidirectionalRelationship can only be traversed from source to target.
bidirectionalRelationship can be traversed in both directions.
The exact navigability values and their behavior may vary. Verify with your Powersheet version.

Complete YAML Example

domainModelTypes:
  Document:
    properties:
      title:
      type:

  Chapter:

  UserNeed:
    polarionType: userNeed
    properties:
      title:
      description:
      severity:

  SystemRequirement:
    polarionType: systemRequirement
    properties:
      title:
      description:
      severity:

  DesignRequirement:
    polarionType: designOutput
    properties:
      title:
      description:

relationships:
  - from: UserNeed
    to: SystemRequirement
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: refines
    direct:
      name: systemRequirements
    back:
      name: userNeeds

  - from: SystemRequirement
    to: DesignRequirement
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: refines
    direct:
      name: designRequirements
      constraints:
        pick:
          document:
            moduleFolder: Design
    back:
      name: systemRequirements

Related pages: Relationships | Cardinality | Binding Syntax | Sources | Expand Clause
KB ArticlesSource Code
  • Direction.java
  • Relationship.java
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/models/constraints-base.yaml
  • Property.java
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/models/constraints_create_only.yaml