Step engine: Workflow overviewEdit on GitHub
To define a multi-step process using the StepEngine feature, you need to implement the following interfaces:
StepInterface: Implements the logic that needs to get executed when the defined step takes place
SubFormInterface: Defines the name of the form and
pathProperty, which is used to fill the property of a transfer object for the current step.
DataContainerInterface: Holds the transfer object you are working on.
The defined steps are wired up through the parameters that are passed when creating
StepCollectionInterface: Contains all the steps that are used in the
DataContainerInterface: Holds the main transfer object and knows how to persist the data during the requests
StepEngine takes care of executing the steps defined in your
StepCollection. To start the multi-step workflow, you need to call the
StepEngine::process() operation from your controller and pass the request object to it; optionally, you can pass
FormCollectionHandlerInterface to it.
Processing the workflow
StepEngine starts to process the multi-step workflow, it iterates through the steps contained in the step collection.
For the current step, it checks if it meets the assigned preconditions by calling
- The preconditions are not satisfied:
RedirectResponseto the defined
- The preconditions are satisfied:
StepCollectionif the current step can be accessed.
If the preconditions are satisfied and the current step can be accessed,
StepEngine needs to verify if the current step needs user input:
- The current step doesn’t need user input:
RedirectResponseto the next step.
- The current step needs user input:
StepEnginetakes the Request object and passes it to
If you have a submitted form,
FormCollectionHandlerInterface handles the request, and if the form validation passes
StepEngine, the execution of the workflow continues.
If the request does not contain valid data for the given form, it redirects the user to the last URL, where the user can correct his input data and submit it again.
StepEngine goes like this through all the steps added to
StepCollection until all the steps are executed.
StepEngine classes can be used without the need to extend them in your project.
For submitting the form