Get transition starting state name and transition name.

@param string $stateName      State name
@param string $transitionName Transition name

@return Transition|null Transition if exists
773395
public function getTransitionByStartingStateAndTransitionName(
        $stateName,
        $transitionName
    ) {
        $transition = array_filter(
            $this->transitions,
            function (Transition $transition) use ($stateName, $transitionName) {
                return
                    $transition->getName() === $transitionName &&
                    $transition->getStart()->getName() === $stateName;
            }
        );

        return !empty($transition)
            ? reset($transition)
            : null;
    }
443183
protected function getNextFollowingTransition($source, $sourceId, $hydrationMode)
    {
        $transition = $this->transitionManager->findOneBySource($source, $sourceId);

        if ($transition !== null) {
            $transitionResult = $this->createTransitionResult(
                $transition->getDestination(),
                $transition->getDestinationId(),
                $hydrationMode
            );

            if (!$transitionResult) {
                return null;
            }

            $transitionResult->setId($transition->getId());
            $transitionResult->setTransition($transition);

            return $transitionResult;
        }

        return null;
    }
205027
protected function _getTransition($key)
    {
        $sKey = (string) $key;

        return array_key_exists($sKey, $this->transitions)
            ? $this->transitions[$sKey]
            : null;
    }
801108
private function getStatusIndex($statusname)
    {
        $status_count = count($this->states);
        for ($i = 0; $i < $status_count; ++$i) {
            if ($this->states[$i]->getName() == $statusname) {
                return $i;
            }
        }
    }
791384
public Transition getTransition(Long id) {
        for (Transition transition : getTransitions()) {
            if (transition.getId().equals(id))
                return transition;
        }
        return null; // not found
    }
389097
function (stateName) {
                this.$Frame.changeState.call(this, stateName);
                this._computeSize();
                var cfg = this._cfg, cssPrefix = this._cssPrefix;
                var parentSpan = this._domElt;
                parentSpan.className = ['xFixedHeightFrame_w ', cssPrefix, 'w'].join("");
                var curSpan;
                curSpan = domUtils.getDomElementChild(parentSpan, 0);
                curSpan.className = ['xFixedHeightFrame_bme ', cssPrefix, 'b ', cssPrefix, 'bkgA'].join("");
                curSpan = domUtils.getDomElementChild(parentSpan, this._mainContentIndex);
                curSpan.className = ['xFixedHeightFrame_bme ', cssPrefix, 'm ', cssPrefix, 'bkgB'].join("");
                curSpan = domUtils.getDomElementChild(curSpan, 0);
                var sizeInfo = {
                    className : ['xFrameContent ', cssPrefix, 'c ', cfg.cssClass].join("")
                };
                this._appendInnerSizeInfo(sizeInfo);
                curSpan.style.width = sizeInfo.width;
                curSpan.style.height = sizeInfo.height;
                curSpan.className = sizeInfo.className;
                curSpan = domUtils.getDomElementChildReverse(parentSpan, 0);
                curSpan.className = ['xFixedHeightFrame_bme ', cssPrefix, 'e ', cssPrefix, 'bkgA'].join("");
            }
812267
public function reachState(
        $startStateName,
        $finalStateName
    ) {
        $transition = $this
            ->machine
            ->reachState(
                $startStateName,
                $finalStateName
            );

        $this->logTransition($transition);

        return $transition;
    }
815207
protected function findTransition(StateInterface $sourceState, StateInterface $targetState, $eventName = null, ConditionInterface $condition = null)
    {
        $conditionName = $condition ? $condition->getName() : null;
        /* @var $transition TransitionInterface */
        foreach ($sourceState->getTransitions() as $transition) {
            $hasSameTargetState = ($transition->getTargetState() === $targetState);
            $hasSameCondition = ($transition->getConditionName() == $conditionName);
            $hasSameEvent = ($transition->getEventName() == $eventName);
            if ($hasSameTargetState && $hasSameCondition && $hasSameEvent) {
                return $transition;
            }
        }
    }
851234
private Transition find(String name) {
        for (Transition t : transitions) {
            if (t.getName().matches(name)) {
                return t;
            }
        }
        return null;
    }
250218
function findFutureState($state, options) {
      if (options.name) {
        var nameComponents = options.name.split(/\./);
        if (options.name.charAt(0) === '.')
          nameComponents[0] = $state.current.name;
        while (nameComponents.length) {
          var stateName = nameComponents.join(".");
          if ($state.get(stateName, { relative: $state.current }))
            return null; // State is already defined; nothing to do
          if (futureStates[stateName])
            return futureStates[stateName];
          nameComponents.pop();
        }
      }

      if (options.url) {
        var matches = [];
        for(var future in futureStates) {
          var matcher = futureStates[future].urlMatcher;
          if (matcher && matcher.exec(options.url)) {
            matches.push(futureStates[future]);
          }
        }
        // Find most specific by ignoring matching parents from matches
        var copy = matches.slice(0);
        for (var i = matches.length - 1; i >= 0; i--) {
          for (var j = 0; j < copy.length; j++) {
            if (matches[i] === copy[j].parentFutureState) matches.splice(i, 1);
          }
        }
        return matches[0];
      }
    }
901137
protected function createTransition($state_name, array $transition_definition)
    {
        $target = $transition_definition['outgoing_state_name'];
        $guard_definition = $transition_definition['guard'];

        $guard = null;
        if ($guard_definition) {
            $guard = $this->service_locator->make(
                $guard_definition['class'],
                [
                    ':options' => $guard_definition['options'],
                ]
            );

            if (!$guard instanceof GuardInterface) {
                throw new RuntimeError(
                    sprintf(
                        "Given transition guard '%s' must implement: %s",
                        $guard_definition['class'],
                        GuardInterface::CLASS
                    )
                );
            }
        }

        return new Transition($state_name, $target, $guard);
    }
1289376
function (stateName) {
            this.$Frame.changeState.call(this, stateName); // this must be
            // called before
            // assigning
            // cssPrefix
            var cfg = this._cfg, cssPrefix = this._cssPrefix, tr, td, getDomElementChild = ariaUtilsDom.getDomElementChild;

            this._computeSize();

            var tds = this._tds;
            if (!tds) {
                tds = [];
                this._tds = tds;
                var tbody = getDomElementChild(this._domElt, 0);
                // Line 1
                tr = getDomElementChild(tbody, 0);
                td = getDomElementChild(tr, 0);
                tds.push({
                    element : td,
                    cssPart1 : 'tlc ',
                    cssPart2 : 'bkgA'
                });
                td = getDomElementChild(tr, 1);
                tds.push({
                    element : td,
                    cssPart1 : 'ts ',
                    cssPart2 : 'bkgB'
                });
                td = getDomElementChild(tr, 2);
                tds.push({
                    element : td,
                    cssPart1 : 'trc ',
                    cssPart2 : 'bkgA'
                });
                // Line 2
                tr = getDomElementChild(tbody, 1);
                td = getDomElementChild(tr, 0);
                tds.push({
                    element : td,
                    cssPart1 : 'ls ',
                    cssPart2 : 'bkgC'
                });
                td = getDomElementChild(tr, 1);
                tds.push({
                    element : td,
                    cssPart : 'm'
                });
                td = getDomElementChild(tr, 2);
                tds.push({
                    element : td,
                    cssPart1 : 'rs ',
                    cssPart2 : 'bkgC'
                });
                // Line 3
                tr = getDomElementChild(tbody, 2);
                td = getDomElementChild(tr, 0);

                tds.push({
                    element : td,
                    cssPart1 : 'blc ',
                    cssPart2 : 'bkgA'
                });
                td = getDomElementChild(tr, 1);
                tds.push({
                    element : td,
                    cssPart1 : 'bs ',
                    cssPart2 : 'bkgB'
                });

                td = getDomElementChild(tr, 2);

                tds.push({
                    element : td,
                    cssPart1 : 'brc ',
                    cssPart2 : 'bkgA'

                });

            }

            var sizeInfo = {
                className : 'xFrameContent ' + cssPrefix + 'c ' + cfg.cssClass
            };
            this._appendInnerSizeInfo(sizeInfo);
            this._childRootElt.style.width = sizeInfo.width;
            this._childRootElt.style.height = sizeInfo.height;
            this._childRootElt.className = sizeInfo.className;

            for (var i = 0, l = tds.length; i < l; i++) {
                td = tds[i];
                if (td.cssPart) {
                    td.element.className = cssPrefix + 'm';
                } else {
                    td.element.className = cssPrefix + td.cssPart1 + cssPrefix + td.cssPart2;
                }
                // frameIcons update
                if (i == 1) {
                    td.element.innerHTML = this.__addFrameIcon(cfg, cssPrefix, 'top');
                }
                if (i == 7) {
                    td.element.innerHTML = this.__addFrameIcon(cfg, cssPrefix, 'bottom');
                }
            }
        }
931859
def __bad_transition(self, state):
        
        statemsg = ""
        oldState = self.stateNames[ self.get_state() ]
        newState = self.stateNames[ state ]
        msg = "Invalid state transition (%s -> %s)" \
              " for breakpoint at address %s"
        msg = msg % (oldState, newState, HexDump.address(self.get_address()))
        raise AssertionError(msg)
518514
public static function formatState($state)
    {
        return isset(self::$stateNames[$state]) ? self::$stateNames[$state] : $state;
    }
609168
public function logTransition(Transition $transition)
    {
        $this
            ->logger
            ->info(
                'Transition {transition_name} in machine "{machine_id}" from "{state_from}" to "{state_to}"',
                [
                    'transition_name' => $transition->getName(),
                    'machine_id' => $this->machine->getId(),
                    'state_from' => $transition->getStart()->getName(),
                    'state_to' => $transition->getFinal()->getName(),
                ]
            );
    }
1099646
public function createTransition(StateInterface $sourceState, StateInterface $targetState, $eventName = null, ConditionInterface $condition = null)
    {
        return new Transition($targetState, $eventName, $condition);
    }
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;
    }