- 🇦🇺Australia sime Melbourne
I am currently using Workflow Buttons → module which takes a transition name and exposes it as a button. This has been working exceptionally well to give the user a much better sense of what they are trying to achieve rather than what the end moderation state will be.
For example a user sees a button [Save Progress] (the name of the transition) and this might push content from Published to Incomplete.
With this in place I can also add triggers when certain transitions are used. This means that when [Save Progress] is triggered I can send an email to that says "Hey well done for saving progress, but you'll need to come back later and finish the job".
So, now I want to add a transition [Request Review] and the permissions are set such that only Managers can execute this. This transition can also move content from Published to Incomplete. This means that I can send an different email when this transition is executed, as it has a different intention that than the transition that normal users can use.
There are a couple of considerations...
- Workflow Buttons module is simply looking at the options on the form by default and finding the best transition. Maybe it could do it a different way and load the transitions that are applicable. This then makes the problem one that can be solved in Workflow Buttons.
- If I was to use the ECA module it works by detecting the FROM->TO state and doesn't offer an ability to detect the transition used.
In the end, I just don't know why you can't have transitions that cover the same FROM->TO. It doesn't make any sense why this is enforced, and if it wasn't enforce it would allow more creative ways for contrib module to leverage the "transition as a verb" idea that was lost when core replaced buttons with a state drop-down.
- 🇦🇺Australia sime Melbourne
The benefit of this is that given a from and to state, we can determine the transition ID.
This is a benefit but not critical - we can already order transitions, so determining the appropraite transition is a case of:
- What transitions are valid for these from/to states
- What transitions does the user have permission to use
- Which transition has the highest priority.
Why I need this :
I have a transition that allows a user to submit a content for review (draft -> needs_review)
I have another transition that allows and admin to "reject" a submitted content (needs_review -> draft), and an email is sent to the user with the reason for rejection (with workbench_email).
But I also want to allow my users to "cancel a submission" (needs-review -> draft), but this would be the same transition as "reject" so they will receive an email saying that their content has been rejected, while it wasn't the case.