/** * @param ProcessInterface $process * @param string $scenarioAlias * * @return RedirectResponse */ protected function goToLastValidStep(ProcessInterface $process, $scenarioAlias) { //the step we are supposed to display was not found in the history. if (null === $this->context->getPreviousStep()) { //there is no previous step go to start return $this->start($scenarioAlias); } //we will go back to previous step... $history = $this->context->getStepHistory(); if (empty($history)) { //there is no history return $this->start($scenarioAlias); } $step = $process->getStepByName(end($history)); $this->context->initialize($process, $step); return $this->redirectToStepDisplayAction($process, $step); }
/** * {@inheritdoc} */ public function setNextStepByName($stepName) { $this->nextStep = $this->process->getStepByName($stepName); }