@Route("/")
@Method({"GET"})

@param type $wizard_id
@param type $step_id
507819
public function wizardAction($wizard_id, $step_id) {

        /**
         * get request
         * validate request
         * not valide getView for error
         * valide 
         *    handle request and get aggregate
         * choose view to display
         * 
         */
//        should I use a manager (pageManager)

        $edit_form = $this->getCreateNewForm();
        $template = $this->getCreateTemplate();
        $params = array(
            'edit_form' => $edit_form->createView()
        );

        return new Response($this->container->get('templating')->render($template, $params));
    }
172919
def get_form(self, step=None, data=None, files=None):
        
        self.form_obj = super(FormWizardAdminView, self).get_form(
            step=step, data=data, files=files)
        return self.form_obj
945735
public function load_question_attempt_step($stepid) {
        $records = $this->db->get_recordset_sql("
SELECT
    quba.contextid,
    COALESCE(q.qtype, 'missingtype') AS qtype,
    qas.id AS attemptstepid,
    qas.questionattemptid,
    qas.sequencenumber,
    qas.state,
    qas.fraction,
    qas.timecreated,
    qas.userid,
    qasd.name,
    qasd.value

FROM      {question_attempt_steps}     qas
JOIN      {question_attempts}          qa   ON qa.id              = qas.questionattemptid
JOIN      {question_usages}            quba ON quba.id            = qa.questionusageid
LEFT JOIN {question}                   q    ON q.id               = qa.questionid
LEFT JOIN {question_attempt_step_data} qasd ON qasd.attemptstepid = qas.id

WHERE
    qas.id = :stepid
        ", array('stepid' => $stepid));

        if (!$records->valid()) {
            throw new coding_exception('Failed to load question_attempt_step ' . $stepid);
        }

        $step = question_attempt_step::load_from_records($records, $stepid);
        $records->close();

        return $step;
    }
893694
public function updateTaskProgress($id, &$step, $maxStep = 0) {
		if (empty($id) || !$this->exists($id) ||
			($maxStep < 1) || ($maxStep < $step)) {
			return false;
		}

		$step++;
		$progress = $step / $maxStep;

		return $this->updateProgress($id, $progress);
	}
700160
public GetStepResponse getStep(String clusterId, String stepId) {
        return getStep(new GetStepRequest().withClusterId(clusterId).withStepId(stepId));
    }
591842
def get(self, record_id):
        
        record_url = self.record_url(record_id)
        return self._get(record_url)
425799
public static function get_widget_instance( $widget_id ) {
		global $wp_registered_widgets;

		if ( ! isset( $wp_registered_widgets[ $widget_id ] ) ) {
			return false;
		}

		$model = $wp_registered_widgets[ $widget_id ]['callback'][0];

		if ( ! is_a( $model, 'Lean\Widgets\Models\AbstractWidget' ) ) {
			return false;
		}

		$key = $wp_registered_widgets[ $widget_id ]['params'][0]['number'];

		$model->_set( $key );

		return $model;
	}
1239066
def get_initkwargs(cls, *args, **kwargs):
        
        assert 'url_name' in kwargs, 'URL name is needed to resolve correct wizard URLs'
        extra_kwargs = {
            'done_step_name': kwargs.pop('done_step_name', 'done'),
            'url_name': kwargs.pop('url_name'),
        }

        initkwargs = super(NamedUrlWizardView, cls).get_initkwargs(*args, **kwargs)
        initkwargs.update(extra_kwargs)

        assert initkwargs['done_step_name'] not in initkwargs['form_list'], \
            'step name "%s" is reserved for "done" view' % initkwargs['done_step_name']
        return initkwargs
299488
public void goToStep(int step) {
        for (int i = 0; i < getWidgetCount(); i++) {
            Widget w = getWidget(i);
            if (w instanceof MaterialStep) {
                ((MaterialStep) w).setActive(false);
            }
        }

        Widget w = getWidget(step - 1);
        if (w instanceof MaterialStep) {
            ((MaterialStep) w).setActive(true);
        }
        setCurrentStepIndex(step - 1);
    }
512764
public function getById($id, $cascade = false) {
        $result = self::getField($this->data, $id, null);
        if ($cascade && null !== $result && isset($this->one[$id])) {
            foreach ($this->one[$id] as $class => $foreignId) {
                $result = array_merge($class::getInstance()->getById($foreignId, $cascade), $result);
            }
        }
        return $result;
    }
216270
def post(self, *args, **kwargs):
        
        # Look for a wizard_prev_step element in the posted data which
        # contains a valid step name. If one was found, render the requested
        # form. (This makes stepping back a lot easier).
        wizard_prev_step = self.request.POST.get('wizard_prev_step', None)
        if wizard_prev_step and wizard_prev_step in self.get_form_list():
            self.storage.current_step = wizard_prev_step
            form = self.get_form(
                data=self.storage.get_step_data(self.steps.current),
                files=self.storage.get_step_files(self.steps.current))
            return self.render(form)

        # Check if form was refreshed
        management_form = ManagementForm(self.request.POST, prefix=self.prefix)
        if not management_form.is_valid():
            raise ValidationError(
                'ManagementForm data is missing or has been tampered.')

        form_current_step = management_form.cleaned_data['current_step']
        if (form_current_step != self.steps.current and
                self.storage.current_step is not None):
            # form refreshed, change current step
            self.storage.current_step = form_current_step

        # get the form for the current step
        form = self.get_form(data=self.request.POST, files=self.request.FILES)

        # and try to validate
        if form.is_valid():
            # if the form is valid, store the cleaned data and files.
            self.storage.set_step_data(self.steps.current, self.process_step(form))
            self.storage.set_step_files(self.steps.current, self.process_step_files(form))

            # check if the current step is the last step
            if self.steps.current == self.steps.last:
                # no more steps, render done view
                return self.render_done(form, **kwargs)
            else:
                # proceed to the next step
                return self.render_next_step(form)
        return self.render(form)
1109186
protected function reachStep(ModelInterface $model, Step $step, ModelState $currentModelState = null)
    {
        try {
            $this->checkCredentials($model, $step);
        } catch (AccessDeniedException $e) {
            $violations = new ViolationList();
            $violations->add(new Violation($e->getMessage()));

            $modelState = $this->storage->newModelStateError($model, $this->process->getName(), $step->getName(), $violations, $currentModelState);

            $eventName = sprintf('%s.%s.bad_credentials', $this->process->getName(), $step->getName());
            $this->dispatcher->dispatch($eventName, new StepEvent($step, $model, $modelState));

            if ($step->getOnInvalid()) {
                $step = $this->getProcessStep($step->getOnInvalid());
                $modelState = $this->reachStep($model, $step);
            }

            return $modelState;
        }

        $event = new ValidateStepEvent($step, $model, new ViolationList());
        $eventName = sprintf('%s.%s.validate', $this->process->getName(), $step->getName());
        $this->dispatcher->dispatch($eventName, $event);

        if (0 === count($event->getViolationList())) {
            $modelState = $this->storage->newModelStateSuccess($model, $this->process->getName(), $step->getName(), $currentModelState);

            // update model status
            if ($step->hasModelStatus()) {
                list($method, $constant) = $step->getModelStatus();
                $model->$method(constant($constant));
            }

            $eventName = sprintf('%s.%s.reached', $this->process->getName(), $step->getName());
            $this->dispatcher->dispatch($eventName, new StepEvent($step, $model, $modelState));
        } else {
            $modelState = $this->storage->newModelStateError($model, $this->process->getName(), $step->getName(), $event->getViolationList(), $currentModelState);

            $eventName = sprintf('%s.%s.validation_fail', $this->process->getName(), $step->getName());
            $this->dispatcher->dispatch($eventName, new StepEvent($step, $model, $modelState));

            if ($step->getOnInvalid()) {
                $step = $this->getProcessStep($step->getOnInvalid());
                $modelState = $this->reachStep($model, $step);
            }
        }

        return $modelState;
    }
865393
private void setCurrentStep(int nNewID) {
        try {
            XPropertySet xDialogModelPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_xMSFDialogModel);
            int nOldStep = getCurrentStep();
            // in the following line "ID" and "Step" are mixed together.
            // In fact in this case they denot the same
            if (nNewID != nOldStep){
                xDialogModelPropertySet.setPropertyValue("Step", new Integer(nNewID));
            }
        } catch (com.sun.star.uno.Exception exception) {
            exception.printStackTrace(System.out);
        }
    }
889567
function step( $description )
    {
        if ( is_string( $description ) )
        {
            foreach (  $this->StepTable as $step )
            {
                if ( $step['class'] == $description )
                {
                    return $step;
                }
            }
        }
        else if ( is_int( $description ) )
        {
            if ( isset( $this->StepTable[$description] ) )
            {
                return $this->StepTable[$description];
            }
        }
        $retValue = null;
        return $retValue;
    }
994396
protected function delete_step($stepid) {
        require_sesskey();

        $step = step::instance($stepid);
        $tour = $step->get_tour();

        $step->remove();
        redirect($tour->get_view_link());
    }
394770
private function getStep($sessionId, $message, $contexts = [])
    {
        $query = $this->queryApi->extractMeaning($message, [
            'sessionId' => $sessionId,
            'contexts' => $contexts,
        ]);

        $query = new Query($query);

        if (null === $query) {
            $query = new Query();
        }

        if ($query->getStatus()->getCode() !== 200) {
            throw new DialogException($query->getStatus()->getErrorDetails(), $sessionId, $query);
        }

        try {
            $step = StepFactory::create($query);
        } catch (InvalidStepException $error) {
            throw new DialogException($error->getMessage(), $sessionId, $error->getQuery());
        }

        return $step;
    }
929618
public function getStep($stepId)
    {
        foreach ($this->steps as $step) {
            if ($step->getId() === $stepId) {
                return $step;
            }
        }

        return $this->dummy;
    }