Problem/Motivation

The message interaction shows a body authored on the workflow, and it is entirely static. An author cannot greet the visitor by name, echo a reference number, or reflect any value the running process carries. Orchestra already stores per-instance and per-branch (token-scoped) process variables, but the message body has no way to read them.

Proposed resolution

Integrate Drupal core token replacement so the message body can carry tokens that resolve against the current process instance and branch at render time.

  • Register an orchestra token type with a dynamic [orchestra:var:NAME] token that resolves a process variable visible to the current branch (the branch-local value when set, otherwise the instance-wide value), plus [orchestra:instance-id] and [orchestra:token-id] identity tokens.
  • Run the message interaction body through the token service in respond(), scoped to the parked instance and token, with cacheability metadata bubbled. The existing admin-HTML filtering is kept after replacement, so variable values are escaped as data rather than treated as markup.
  • Internal bookkeeping variables (double-underscore prefix) stay hidden, matching the engine getVariables() view.
  • Document the available tokens in the message field help.

Remaining tasks

  • Add the token_info and tokens hooks (OOP #[Hook]).
  • Wire the token service into MessageInteraction::respond().
  • Kernel test coverage for replacement and for branch-versus-instance scoping.
  • phpcs, phpstan and cspell.

User interface changes

The message field gains help text listing the supported tokens; the rendered message shows resolved values.

API changes

None. Additive only: a new orchestra token type.

Issue fork orchestra-3607018

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’s picture

Status: Active » Needs review

  • mably committed 22f0ae57 on 1.x
    feat: #3607018 Use Drupal tokens to insert process variables into the...
mably’s picture

Status: Needs review » 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.