Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow transitions to have multiple "from" states #12

Open
tlotze opened this issue Oct 31, 2018 · 0 comments
Open

Allow transitions to have multiple "from" states #12

tlotze opened this issue Oct 31, 2018 · 0 comments

Comments

@tlotze
Copy link

tlotze commented Oct 31, 2018

Some transitions make sense in more than one state, for example for the owner of a document in a CMS to retract it from any stage of review or publication to private, or for an editor-in-chief to publish a document regardless of review state.

Currently, as we cannot have one transition with one name for, e.g., "retract form any state", we cannot express "workflow.transition('retract')" but we'd either have to find out which of the transitions named "retract_from_review", "retract_from_public" etc we have to perform, or we have to call "workflow.transition_to_state('private')" which requires the code to implicitly know that retracting is to state private, without being able to reuse that knowledge as expressed in the workflow definition.

Also, having to create separate transitions with unique names and different "from" states, but otherwise identical properties makes even moderately complex workflows unnecessarily hard to grasp. It would be helpful to allow for the from_state attribute to be a set of states, denoted as space-separated list in ZCML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant