Returns all enabled transitions.

@param object $subject A subject
@param string $name    A workflow name

@return Transition[] All enabled transitions
329103
public function getEnabledTransitions($subject, $name = null)
    {
        return $this->workflowRegistry->get($subject, $name)->getEnabledTransitions($subject);
    }
666658
protected function _success(Subject $subject)
    {
        $subject->set(['success' => true, 'created' => true]);

        $this->_trigger('afterSave', $subject);
        $this->setFlash('success', $subject);

        return $this->_redirect($subject, ['action' => 'index']);
    }
1133849
public function getFiniteTransitions($object, $graph = 'default', $as_object = false)
    {
        return $this->context->getTransitions($object, $graph, $as_object);
    }
732210
public function findOrCreateTransition($sourceStateName, $targetStateName, $eventName = null, ConditionInterface $condition = null)
    {
        $sourceState = $this->findOrCreateState($sourceStateName);
        $targetState = $this->findOrCreateState($targetStateName);
        $transition = $this->findTransition($sourceState, $targetState, $eventName, $condition);
        if (!$transition) {
            $transition = $this->createTransition($sourceState, $targetState, $eventName, $condition);
            $this->addTransition($sourceState, $transition);
        }

        return $transition;
    }
462194
public function isSatisfiedBy($subject)
    {
        return $this->spec1->isSatisfiedBy($subject)
            && $this->spec2->isSatisfiedBy($subject);
    }
789449
public function getHeaderLines(string $name): array {
        $key = strtolower($name);
        $result = isset($this->headers[$key]) ? $this->headers[$key] : [];
        return $result;
    }
409795
public function getAssignmentsByName($name)
    {
        $result = [];

        foreach ($this->getAssignments() as $assignment) {
            /* @var AssignmentElement $assignment */
            if ($assignment->getName() === $name) {
                $result[] = $assignment;
            }
        }

        return $result;
    }
238973
protected function getServiceNamedSpec($name, $constructorArgs = [])
    {
        $spec = $this->getServiceSpec($name);
        if ($spec) {
            // Resolve to exact service name (in case inherited)
            $name = $this->getServiceName($name);
        } else {
            // Late-generate config spec for non-configured spec
            $spec = [
                'class' => $name,
                'constructor' => $constructorArgs,
            ];
        }
        return [$name, $spec];
    }
1135092
public function all($name)
    {
        $items = [];

        if ($this->hasValue($name)) {
            $items[] = $this->getValue($name);
        }

        foreach ($this->getStructures() as $childStructure) {
            $items = array_merge($items, $childStructure->all($name));
        }

        return $items;
    }
941931
public function getAvailableTransitions(Workflow $workflow, AbstractSubject $subject, array $metaData = null): Generator
    {
        $bugId = $metaData['bugId'] ?? null;

        if (!$bugId) {
            throw new Exception('Missing bug id');
        }
        $bug = $this->entityManager->getRepository(Bug::class)->find($bugId);

        if (!$bug || !$bug instanceof Bug) {
            throw new Exception(sprintf('No task found for id %d', $bugId));
        }

        $path = Path::unserialize($bug->getPath());
        foreach ($path as $index => $step) {
            $transitionName = $step[0];
            $data = $step[1];
            if ($transitionName) {
                if (is_array($data)) {
                    $subject->setData($data);
                    $subject->setNeedData(false);
                } else {
                    $subject->setNeedData(true);
                }
                yield $transitionName;
            }
        }
    }
191467
public function defaultStatuses($name)
    {
        return [
            'label' => $name,
            'public' => false,
            'internal' => false,
            'exclude_from_search' => false,
            'show_in_admin_all_list' => true,
            'show_in_admin_status_list' => false,
            'label_count' => Translate::n($name.' <span class="count">(%s)</span>', $name.' <span class="count">(%s)</span>'),
        ];
    }
1048567
public function getTransitions()
    {
        if (count($this->transitions) == 0 && !$this->isInitialType() && !$this->isExceptionType()) {
            foreach ($this->properties['transitions_from'] as $transition) {
                array_push($this->transitions, new Transition($this, $transition));
            }

            if (count($this->transitions) == 0) {
                throw new StatusException('No transitions available', 100, null);
            }
        } elseif ($this->isInitialType() || $this->isExceptionType()) {
            $this->transitions = [];
        }

        return $this->transitions;
    }
99183
public function children($name = null)
    {
        $child = $this->get($name);
        if (!$child) {
            return [];
        }
        return $child->_children;
    }
272150
public function getAll($name)
    {
        $s = $this->getNormalizedHeaderName($name);
        $ret = [];
        if (!empty($this->headerMap[$s])) {
            foreach ($this->headerMap[$s] as $index) {
                $ret[] = $this->getByIndex($index);
            }
        }
        return $ret;
    }
4259
public function getAssignmentForSubject(Subject $subject)
    {
        return $this->assignmentStorage->getAssignment($subject->getSubjectId(), $subject->getSubjectName());
    }
758900
public function getTransitionsByStartingState($stateName)
    {
        return array_filter(
            $this->transitions,
            function (Transition $transition) use ($stateName) {
                return $transition
                    ->getStart()
                    ->getName() === $stateName;
            }
        );
    }
969101
protected function processChildIdentifier(DataObject $object, $name)
    {
        if ($this->isChildIdentifier($name)) {
            
            $name = ltrim($name, '+');
            
            if ($this->isTypedIdentifier($name)) {
                return $this->processTypedIdentifier($name);
            }
            
            return [$object->defaultChild(), $name];
            
        }
    }