I'm creating a WF and all is good until I want to create a transition called "Return". I assume this is common in WF as you want the ability to "return' the content to the person who sent it to you.
When i created the transition "Return" i thought there would be an option in the "Destination state" option that would include somehting like: "return to previous state". of course it doesn't, hence the question.
Doesn't WF machinery know which state the content was in before this state, hence the ability to return to previous state?
So, since this doesn't appear to be an option, does that mean i need to create a different transition for each return? e.g. "return to xx State'
Wayne Glover via Plone Community wrote at 2023-6-22 23:00 +0000:
...
i thought there would be an option in the "Destination state" option that would include somehting like: "return to previous state". of course it doesn't, hence the question.
When you design a feature (such as "workflow support"),
it is always possible to put in further functionality -- at
the cost of greater complexity and increased development and
maintenance costs.
Therefore, you have to balance generality and complexity.
The Products.DCWorkflow design is based on a simple
(easy to understand, implement and maintain) state machine
with states and transitions between (literal) states.
While it would have been possible to specify the transistion target state via
variables (instead of a literal state selected from a state menu)
it would have introduced a lot of conceptional, implementation and UI
complexity -- to the benefit of very few use cases (such as yours).
Therefore, it is not done.
However, Plone (and its underlaying CMFCore) does not
force you to use DCWorkflow for the workflow implementation.
You can implement your own workflow tool (likely based on the DCWorkflow
tool) and tell Plone (via GenericSetup) to base portal_workflow on your implementation.
DCWorkflow targets a large audience; its features must therefore
be easily understandable and thoroughly documented and tested.
Your extension must only satisfy your own requirements;
it therefore may contain ad hoc solutions (e.g. a special
transaction the target state of which is not selected via a
state menu but fixed to be the current state or
the addition of a special entry "remain in state" in the state selection
menu).
@dieter Thank you for the thoughtful reply. I realize there are always tradeoffs and sometimes what appears simple (why can't it go back to the previous state) is difficult to implement. This did get me to create a simple work around.
I've thought a little about the solution which can use the existing Plone machinery.
I will create individual transition for each return (e.g. "return to Private") and use that only in that one transition. however, I can name all of these transitions "Return" in the "Display in Action Box" which is what the user will see. Thus a few minutes of my time and no confusion to the user. I call that a win.