Skip to content

Views and dashboards

The optional Orchestra Views submodule (orchestra_views) exposes the engine's runtime entities to Views, so you can build dashboards over your processes without writing code. Enable it and the Orchestra content entities become Views base tables, complete with relationships, readable labels and a tenant-aware filter; it also ships five ready-made dashboards you can use as-is or clone.

What it exposes

Installing the module attaches a Views data handler to each Orchestra content entity, turning every base field into a field/filter/sort and every reference into a relationship:

Base table Entity Key relationships
orchestra_instance Process instance parent token
orchestra_token Token (a branch in flight) instance, parent token
orchestra_variable Process variable instance, token
orchestra_work_item User task (needs orchestra_inbox) instance, token, assignee

Workflows, tenants and the other configuration live as config entities, which Views cannot use as base tables; the dashboards reach them through the readable fields below instead.

Readable labels

The runtime stores machine names for speed: an instance keeps its workflow's machine name, a token keeps a node ID local to that workflow. Two extra fields resolve those to the human labels a dashboard wants:

  • Workflow (on the instance): resolves the stored machine name to the workflow's label. The raw value is still available as Workflow (machine name).
  • Node label (on the token): resolves the token's node ID against its instance's workflow definition.

There is also a Workflow filter on the instance that offers the workflows by label as a select/checkbox list, so you can scope a dashboard to one or more workflows without typing machine names.

Process variables as columns

A process carries named variables (see Concepts), and the instance offers a Process variable field that shows one of them as a column. Add the field, name the variable, and choose how to display it:

  • Variable: the variable to show. A dotted path reads into a structured value, the same syntax flow conditions use: order.total shows the total key of the array held in order. A plain name shows a scalar.
  • Display as: Text, Number, Date (a Unix timestamp or a date string, formatted with the chosen date format), or Yes/No for a boolean.

The field reads the instance-wide value, not a branch's token-local one, and the named variable is loaded once for the whole page, so a column over many instances stays one query. Add the field more than once to show several variables side by side.

Tenant scoping

Every Orchestra entity carries a tenant (see Multi-tenancy). The module adds a Current tenant filter to all four entities: enabled, a view shows only the rows of the tenant the request is acting in. The shipped dashboards all carry this filter, so on a multi-tenant site each operator sees only their own tenant's work; on a single-tenant site every row is the default tenant, so the filter simply narrows to everything.

The orchestra_tenant cache context

The filter resolves the active tenant through the same tagged resolvers the engine uses, and declares the orchestra_tenant cache context so cached output never leaks across tenants. That cache context ships in the base module and is reusable by any tenant-scoped render (a block, a custom dashboard).

The shipped dashboards

Enabling the module installs these page views, each scoped to the current tenant. They are ordinary views: clone or edit them freely.

View Path Shows Permission
Orchestra processes /admin/orchestra/dashboard/processes running instances, by workflow label Administer Orchestra
Orchestra tokens /admin/orchestra/dashboard/tokens live tokens (not consumed/cancelled), by node label Administer Orchestra
Orchestra inbox /admin/orchestra/dashboard/inbox open user tasks Reassign Orchestra tasks
Orchestra completed processes /admin/orchestra/dashboard/completed finished instances (completed, cancelled, failed), with started/ended times Administer Orchestra
Orchestra process trace /admin/orchestra/dashboard/trace/{id} one instance's node-by-node history Administer Orchestra

The inbox view only installs when orchestra_inbox is enabled, because that is where the work-item entity lives.

Process history and trace

A finished process keeps its whole execution: every node it passed through is a retained token (the engine consumes a token rather than deleting it, and spawns the next one on the outgoing flow), so the token table already holds the trail. Two views surface it:

  • Completed processes lists finished instances with their started (created) and ended (changed) times, the reporting counterpart to the running dashboard.
  • Process trace takes an instance ID in its path and lists all that instance's tokens (consumed ones included) in chronological order, showing the node, status, the flow each arrived on and its parent token (the branch it belongs to). The processes and completed dashboards carry a Trace link per row that opens it.

This is a per-node-occupancy trail: each token records when it arrived and its final state, which reconstructs which nodes ran, in what order, on which branch and ending how. It is not a full per-transition event log (a token keeps only its last changed time, and variable changes are not retained); a durable, append-only audit log is a separate, future step.

Building your own

Add a view on any of the four base tables and you have the fields, filters and relationships above to work with. A few patterns:

  • Per-workflow board: add the Workflow filter (exposed) and group by it.
  • Stuck work: on tokens, filter status = parked and sort by deadline.
  • Variables of a process: start from orchestra_variable, add the instance relationship, expose an instance ID argument.
  • My tasks: on work items, add the assignee relationship to users.

Bulk actions

To act on rows from a dashboard, enable the Orchestra VBO (orchestra_vbo) submodule and add a Views bulk operations field to a view. It ships Views Bulk Operations actions over the same entities:

Submodule Entity Actions Permission
orchestra_vbo Process instance Cancel process, Delete process Administer Orchestra
orchestra_vbo Token Resume (signal) token, Cancel token Administer Orchestra
orchestra_vbo_inbox Work item (task) Claim (assign to me), Complete task, Reassign task Process / Reassign Orchestra tasks

The process and token actions (orchestra_vbo) are plain Drupal action plugins, so they also work with core's bulk-actions field. The task-inbox actions (orchestra_vbo_inbox) need orchestra_inbox; Complete task takes an optional outcome to record on each task, and Reassign task a target user. Each action is gated on the matching permission.