Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

Check whether it is possible to reach a step (canReachNextStep) #17

@archie18

Description

@archie18

Hi,
when trying to use LexikWorkflowBundle for our project the need arose to be able to check whether a process can reach a next step without actually advancing the model to the next step. In more practical terms, I would like to know whether a user of my system is able to submit a certain web form before actually showing the form to the user. So I probably need something along the lines of:

if ($processHandler->canReachNextState($model, 'validate')) {...}

Like this we avoid duplicating code in the workflow validators and form controllers.

Is there a function like this? I didn't find one.

If there is not, I would probably simply copy $processHandler::reachNextState() and adapt the method to my needs. This rises the next question:

What is the best way to extend the ProcessHandler?

Cheers,
Andreas

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