Skip to content

Allow transitions to have multiple "from" states #12

@tlotze

Description

@tlotze

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions