Step Event Handler
The Step event handler is responsible for rendering the form a step and for validating the form on submission. Because all steps use the Step event handler, it is best to call step specific methods from the Step event handler to do this for individual steps; the StepHandlerTrait provides this functionality, calling methods with the same name as the current step.
If what the Step event handler does sounds like what would happen in an action, that's because it is. The main difference is that instead of returning a response as an action would, the Step event handler either:
Calls StepEvent::setResponse($response) with the rendering result if it is rendering the step's form; either for the first time or if form validation has failed
Calls StepEvent::setData($data) to pass the form data to Wizard if form validation passes
Step event handler can also do a couple of other things:
Set branches - if Plot Branching Navigation is being used, the Step event handler can enable or disable branches depending on form data
Decide the next step to be processed - go back to a specific step, back a step, repeat the current step, or move forward