Skip to main content

Create a Computed Property

Add a server-rendered property to your domain model that computes its value dynamically from work item data, related entities, or platform services.

Use Velocity Templates

Write Velocity template expressions that access work item fields, document context, and the full set of context variables available during rendering.

Access Polarion Services

Call Polarion platform services such as $trackerService, $repositoryService, and $securityService from within your Velocity templates for advanced queries and permission checks.

Debug Template Errors

Diagnose and resolve common rendering failures including parse errors, missing variables, method invocation exceptions, and the #SERVER_RENDER_ERROR marker.

How Server Rendering Works

The following diagram shows how a server-rendered property flows from configuration to display.
 Domain Model YAML              Server API                  Sheet
 +-----------------------+      +---------------------+     +------------------+
 | entity: Hazard        |      | 1. Parse YAML       |     |                  |
 | properties:           | ---> | 2. Detect            | --> | Rendered value   |
 |   riskLevel:          |      |    serverRender      |     | shown in cell    |
 |     serverRender: ... |      | 3. Build Velocity    |     |                  |
 +-----------------------+      |    context ($item,   |     +------------------+
                                |    $wi, $module,     |
                                |    $context, $tx)    |
                                | 4. Evaluate template |
                                | 5. Return result     |
                                +---------------------+
When a property includes a serverRender definition, the server API evaluates the Velocity template for each entity row. The template receives a pre-populated context containing the current work item, document, transaction, and injected Polarion services. The evaluated result is returned as the property value and displayed in the sheet column.
Server-rendered properties are best suited for values that cannot be expressed as a simple field binding:
  • Cross-entity lookups — aggregate or reference data from linked work items
  • Conditional formatting — compute display strings based on multiple field values
  • Platform queries — run Lucene queries via $trackerService to count or filter related items
  • Permission-aware values — use $securityService to vary output by user role
For straightforward field display or client-side calculations, use standard column bindings or the formula expression in your sheet configuration instead.
Context VariableTypeDescription
$itemModelObjectCurrent work item with access to all properties
$wiIWorkItemLow-level Polarion work item API (work items only)
$moduleIModuleCurrent LiveDoc document context (null for non-document entities)
$contextIDatabridgeContextServer API context with project and query capabilities
$txTransactionCurrent transaction for scoped read operations
$trackerServiceITrackerServiceQuery work items, run Lucene searches, access tracker metadata
$repositoryServiceIRepositoryServiceAccess project metadata, users, and repository configuration
$securityServiceISecurityServiceCheck permissions and enforce role-based visibility
Source Code
  • ServerRenderer.java
  • ServerRendererTest.java
  • Property.java
  • DataPropertyFactory.java
  • QueryDataTest.java