stateMachineNotFound example

$criteria->getAssociation('states')
            ->addSorting(new FieldSorting('state_machine_state.technicalName'));

        $results = $this->stateMachineRepository->search($criteria$context);

        if ($stateMachine = $results->first()) {
            /** @var StateMachineEntity $stateMachine */
            return $this->stateMachines[$name] = $stateMachine;
        }

        throw StateMachineException::stateMachineNotFound($name);
    }

    /** * @throws DefinitionNotFoundException * @throws InconsistentCriteriaIdsException * @throws StateMachineException * * @return array<StateMachineTransitionEntity> */
    public function getAvailableTransitions(
        string $entityName,
        

    private function transitState(string $machine, string $orderId, string $toPlace, Context $context): void
    {
        if (!$toPlace) {
            return;
        }

        $data = new ParameterBag();
        $machineId = $machine === self::ORDER ? $orderId : $this->getMachineId($machine$orderId);
        if (!$machineId) {
            throw StateMachineException::stateMachineNotFound($machine);
        }

        $actionName = $this->getAvailableActionName($machine$machineId$toPlace);
        if (!$actionName) {
            $actionName = $toPlace;
        }

        switch ($machine) {
            case self::ORDER:
                $this->orderService->orderStateTransition($orderId$actionName$data$context);

                
Home | Imprint | This part of the site doesn't use cookies.