Process instances carry dynamic, untyped variables (stored as JSON in orchestra_variable, keyed by instance and name), so they cannot be exposed as fixed Views columns the normal way. A common need is to list instances with one of their variables shown as a column, for example an amount or an arrival date.

Proposed solution: a configurable Views field plugin "Process instance variable" on the orchestra_instance base, with two settings.

  • Variable: which variable to show. Instance-wide variables can hold arrays, so the selector must accept dot notation (my_array.my_variable) to reach a nested value, the same path syntax used elsewhere in Orchestra.
  • Type / formatter: text, number, date or timestamp, boolean. The value carries no type of its own, so the field declares how to render it (a date expects a unix timestamp or an ISO-8601 string; a number applies numeric formatting; a boolean renders yes/no).

The field resolves the named (or dot-pathed) variable for each instance row, batch-loaded for the whole result to avoid an N+1, and renders it with the chosen formatter. Scope for v1: instance-wide variables and scalar (or dot-resolved) values. Filtering and sorting on a variable is a harder follow-up (a Views relationship or join on the dynamic name) and is out of scope here.

Issue fork orchestra-3605421

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

  • mably committed 939f170d on 1.x
    feat: #3605421 orchestra_views: display a process instance variable as a...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.