Skip to main content
diagram

Entity Types

The Salesforce model defines entity types under domainModelTypes, mapping business concepts to Polarion work item types.
PropertyTypeDefaultDescription
domainModelTypesarray[]Top-level array containing all entity type definitions.
domainModelTypes[].namestringNoneUnique identifier for the entity type. Used in relationships and queries.
domainModelTypes[].polarionTypestringNoneMaps to a Polarion work item type ID. If omitted, uses entity type name.
domainModelTypes[].propertiesarray[]Property definitions for the entity type. Each maps to a Polarion field.
domainModelTypes[].properties[].namestringNoneProperty name mapping to a Polarion work item custom field or built-in field.

CRM Entity Definitions

domainModelTypes:
  - name: Account
    polarionType: account
    properties:
      - name: description
      - name: industry
      - name: website
      - name: annualRevenue

  - name: Opportunity
    polarionType: opportunity
    properties:
      - name: description
      - name: stage
      - name: amount
      - name: closeDate

  - name: Task
    polarionType: task
    properties:
      - name: description
      - name: status
      - name: priority
      - name: dueDate
This model shows that Powersheet domain models can represent any entity hierarchy, not just engineering artifacts. As long as each entity type maps to a Polarion work item type, any business domain can be modeled.

Relationships

Relationships connect the CRM entities with bidirectional navigation properties.
PropertyTypeDefaultDescription
relationshipsarray[]Defines all relationships between entity types.
relationships[].fromstringNoneSource entity type. Must reference a domainModelTypes[].name.
relationships[].tostringNoneTarget entity type. Must reference a domainModelTypes[].name.
relationships[].cardinalitystringNoneMultiplicity of the relationship between entities.
relationships[].storagestringNonePersistence mechanism. linkedWorkItems uses Polarion native links.
relationships[].linkRolestringNonePolarion link role ID. Must match a configured link role.
relationships[].fromNavPropNamestringNoneNavigation property added to the source entity for forward traversal.
relationships[].toNavPropNamestringNoneNavigation property added to the target entity for reverse traversal.

CRM Relationship Definitions

relationships:
  - from: Account
    to: Opportunity
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: relates_to
    fromNavPropName: opportunities
    toNavPropName: accounts

  - from: Account
    to: Task
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: relates_to
    fromNavPropName: tasks
    toNavPropName: accounts

Sheet Configuration for Salesforce Model

A sheet configuration using this model displays accounts with expandable opportunities and tasks:
columns:
  title:
    title: Account Name
    width: 250
    hasFocus: true
  opportunities.opportunity.title:
    title: Opportunity
    width: 200
  opportunities.opportunity.stage:
    title: Stage
    width: 120
  tasks.task.title:
    title: Task
    width: 200

sources:
  - id: accounts
    title: Accounts
    model: salesforce
    query:
      from: Account
    expand:
      - name: opportunities
      - name: tasks

Constraints and Picker Filters

The Salesforce model can use the same constraint system as engineering models.
domainModelTypes:
  - name: Account
    polarionType: account
    properties:
      - name: description
      - name: industry
    constraints:
      pick:
        document:
          moduleFolder: CRM
          type: accountDocument
The constraint configuration above follows the standard Powersheet pattern. Verify that your Polarion project has the corresponding document types and module folders configured.

Complete YAML Example

domainModelTypes:
  - name: Account
    polarionType: account
    properties:
      - name: description
      - name: industry
      - name: website
      - name: annualRevenue

  - name: Opportunity
    polarionType: opportunity
    properties:
      - name: description
      - name: stage
      - name: amount
      - name: closeDate

  - name: Task
    polarionType: task
    properties:
      - name: description
      - name: status
      - name: priority
      - name: dueDate

relationships:
  - from: Account
    to: Opportunity
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: relates_to
    fromNavPropName: opportunities
    toNavPropName: accounts

  - from: Account
    to: Task
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: relates_to
    fromNavPropName: tasks
    toNavPropName: accounts

Mapping Decisions

DecisionSalesforce EquivalentPowersheet Mapping
Entity type nameObject (Account, Opportunity)domainModelTypes[].name
Polarion typeN/ApolarionType maps to work item type
Lookup relationshipAccount -> Opportunityrelationships with linkedWorkItems storage
FieldStandard/Custom fieldproperties[].name mapping to Polarion fields
Link typeRelationship typelinkRole in Polarion link role configuration

See Also

Code: sf_model.yaml, constraints_pick_only.yaml, Model Helper KB article
KB ArticlesSource Code
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/constraints_currentDocument_downstream.template.yaml
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/constraints_model.template.yaml
  • powersheet.yaml
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/whole_rtm.template.yaml
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/e2e/admin/admin.cy.ts