Problem/Motivation
An outcome has no color anywhere. The inbox history shows rejected and approved as the same plain text, and a step's Context to display shows a comment at a severity fixed in the entry (variable | label | severity), while the right level depends on the decision that came with the comment.
Example: a request goes through two validation steps, head of service then HR, and both record their comment in the same comment variable, validation_comment. The next step displays validation_comment | Validation comment | warning: an approval comment and a rejection comment both show as a warning. The displayed value cannot tell either: the comment variable is a plain string, and a stored variable does not record which step wrote it.
Proposed resolution
Give each outcome a color, from the status palette the module already uses for statuses (Neutral, Info, Success, Warning, Danger), and use it wherever the outcome or its comment is shown.
- Step settings: an optional color per outcome on every human node, next to the outcome labels, stored as
outcome_classes(palette classes such asis-danger). - Outcome column: the Outcome (label) Views field gets a Render as a styled tag option, showing the outcome as a status tag in its color; the inbox history ships with it on.
- Comment severity: derived from the color (Danger as an error, Warning as a warning, the others as a status message) and written next to the comment, in the same write and scope, so whichever step wrote the comment also wrote its severity: as the
severityentry of a structured return value (validation.severity), and beside a comment variable asNAME_severity(validation_comment_severity), always written, empty when the outcome has no color. Only the step sets it: a severity in the submitted payload is dropped. - Context display: an entry with no severity uses the one written next to its value. An explicit severity still wins, and a value with none next to it falls back to status, so existing configurations behave as before.
With this, a single entry validation_comment | Validation comment shows a rejection as an error and an approval as a status message, whichever validation step wrote it, and the history shows the same outcomes in red and green.
Remaining tasks
- Review the merge request.
User interface changes
An Outcome colors select per outcome in the human step settings; a Render as a styled tag option on the outcome Views field, on in the shipped inbox history; the context display severity becomes optional.
API changes
WorkItemManagerInterface::getOutcomeClass().
Data model changes
New outcome_classes key in the human node configuration. A structured completion payload gains a severity key, and a configured comment variable gains a NAME_severity companion variable.
AI-Generated: Yes (Claude Code was used to help draft this issue summary and to write the change and its tests. I reviewed them.)
Issue fork orchestra-3628640
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
Comment #3
mably commentedComment #4
mably commentedComment #5
mably commentedComment #7
mably commented