Problem/Motivation
Workflows currently provides StateInterface and TransitionInterface for the State and Transition value objects. Content Moderation also uses StateInterface for ContentModerationState value object.
Do we need these interfaces?
Discussion started in #2899553: Architectural review of the Workflows module (documentation cleanups) at #29.
Proposed resolution
Discuss.
Remaining tasks
User interface changes
API changes
Possible removal of these two internal interfaces.
Comments
Comment #2
sam152 commentedIf there are two implementations, the interface is required. So perhaps the issue should clarify the terminology around "value objects" in the comments?
Comment #3
sam152 commentedGiven we have methods like
WorkflowTypeInterface::getTransitionswhich are@apithat return an array of objects that implement an@internalinterface, this should probably be resolved for 8.5.Additionally I missed that #2896724: Create constants for transition directions. introduced a constant on an
@internalinterface, to be used as an argument for an@apimethod. I suspect the outcome of this will be, those interfaces will become@api, so hopefully not an actual problem?Adding some context to the IS which will help us decide what to do with these.
Comment #5
nigelcunningham commentedI have a further argument for treating Transitions as entities in their own right: I'm preparing a quote for a client that wants transitions to require approval from multiple users. To my mind, it makes most sense to implement this by having transitions be entities supporting the implementation of the rules that are required.
If this quote goes further, I'll do more work but happy to participate in further discussion.
Comment #17
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #18
amateescu commentedI think this still needs to be settled, and the answer for the decision part is "yes" from my POV.
Both Content Moderation in core and other projects in contrib provide their own value objects for states and transition, and it would be nice to have at least the common methods on an interface.