Skip to main content

Template Evaluation

diagram

Context Variables

The following variables are available in every Velocity template evaluation.

Examples

$item (ModelObject) exposes work item fields directly; $wi (IWorkItem) is the low-level Polarion API for operations not surfaced on $item, such as link traversal:
See Context Variables for detailed documentation on each variable, including the full $item, $wi, and $pObject member lists.

$context members

The $context (PowersheetContext) variable groups the Powersheet-specific scope and query helpers. Access members by name, for example $context.document.id:
The exact members available on $context depend on the Powersheet version. Consult the Polarion server logs for the available context properties if a member does not resolve.

Platform Services

Platform services are cached and pre-injected into every template evaluation. The method examples shown for these services throughout this page are illustrative — the exact method set on each service depends on your Polarion server version (see Verify in application below). See Polarion Services for detailed service documentation.

Template Syntax

Velocity templates use standard Apache Velocity syntax.

Variable References

Conditional Logic

Method Calls

The exact methods available on each service depend on the Polarion server version. The authoritative, version-matched reference is the Polarion SDK Javadoc, which ships with your installation — open [POLARION_INSTALL]/polarion/SDK/doc/sdk/index.html (the interfaces above, such as ITrackerService and ISecurityService, are documented there). Always confirm method signatures against the SDK for your server version rather than relying on the illustrative examples here.
A stable public URL for the Polarion Javadoc is intentionally not linked here, because Siemens does not publish a version-agnostic permalink and the API surface differs between releases. Use the locally shipped SDK Javadoc above, or the official Siemens Polarion developer documentation for your specific version.

Error Handling

When a Velocity template fails to evaluate, the cell displays #SERVER_RENDER_ERROR. Check the Polarion server logs for the specific error details (parse errors, method invocation errors, or missing resources).

Template Performance

Server-rendered templates execute for every work item returned by a query. Avoid expensive operations (e.g., complex Lucene queries within templates) that multiply across large result sets.

Server-Rendered Property Configuration

Server-rendered properties are defined in the data model using the serverRender annotation. When a property has serverRender configured, it becomes read-only (not updatable) regardless of other permission settings. This is part of the broader read-only resolution behavior documented canonically in Configure Read-Only Column.

Test Context Validation

The server renderer validates that the Velocity context contains the required variables:

Document Parameters in Templates

Document parameters can be used within Velocity templates via the $context variable:
See JavaScript Functions for client-side $context expressions.

Complete YAML Example

Data model with a server-rendered property:
Sheet configuration referencing the computed property:
(The Context Variables and Polarion Services references are linked inline from the sections above.)
Last modified on July 10, 2026