Allow to set multiple workflows for the group service tag

Created on 13 August 2020, over 4 years ago
Updated 12 June 2023, over 1 year ago

Problem/Motivation

Some time, we are creating different workflow but some are sharing the same logic and could share the same guards.
Ex: workflows that contains l10n steps (content validation->translation->validation of the translation)
I would be happy to have only one guard for all those workflows:
-Checking everything is translated to allow to validate translations
-Checking everything is validated before being published
-and so on

Note that, I use the same transition id and state id for the "shared transition logic" to ease the coding

Proposed resolution

Allow to have multiple workflows asigned to the group service tag in the guard service definition
(with BC compatibility)

  mymodule.transition_l10n_guard:
    class: Drupal\mymodule\Guard\L10NGuard
    tags:
      - { name: state_machine.guard, group: [workflow1, workflow2] }

Of course, I can use the generic guard (without the group service tag, but it will fire every time...

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇧🇪Belgium DuneBL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024