A transition to the given state.
969292
private static Transition makeTransitionToStateLiteral(String literal, final HtmlContext state) {
    return new Transition(literal) {
      @Override
      Context computeNextContext(Context prior, Matcher matcher) {
        return prior.transitionToState(state);
      }
    };
  }
925003
public void setModificationState(ModificationState newModificationState)
    {
        if(newModificationState != modificationState)
        {
            if(log.isDebugEnabled())
            {
                log.debug("object state transition for object " + this.oid + " ("
                        + modificationState + " --> " + newModificationState + ")");
//                try{throw new Exception();}catch(Exception e)
//                {
//                e.printStackTrace();
//                }
            }
            modificationState = newModificationState;
        }
    }
453685
function handleAuthorizedState() {
        PermTransitionEvents.broadcastPermissionAcceptedEvent();

        // Overwrite notify option to broadcast it later
        var transitionOptions = angular.extend({}, PermTransitionProperties.options, {
          notify: false,
          location: true
        });

        $state
          .go(PermTransitionProperties.toState.name, PermTransitionProperties.toParams, transitionOptions)
          .then(function () {
            PermTransitionEvents.broadcastStateChangeSuccessEvent();
          });
      }
884565
def state(self, state):
        ''''''
        logger.debug('client changing to state=%s', ClientState.Names[state])
        self._state = state
382336
def get_transition(self,  # suppress(too-many-arguments)
                       line,
                       line_index,
                       column,
                       is_escaped,
                       comment_system_transitions,
                       eof=False):
        """"""
        parser_transition = {
            STATE_IN_COMMENT: InCommentParser,
            STATE_IN_QUOTE: InQuoteParser
        }

        (state,
         start_state_from,
         waiting_until) = comment_system_transitions.from_text(line,
                                                               line_index,
                                                               column,
                                                               is_escaped)

        # We need to move ahead by a certain number of characters
        # if we hit a new state
        if state != STATE_IN_TEXT:
            return (parser_transition[state](start_state_from,
                                             waiting_until),
                    start_state_from[1] - column,
                    None)
        else:
            return (self, 1, None)
991244
def transition_to_execute(self):
        """"""
        assert self.state in [AQStateMachineStates.add]
        self.state = AQStateMachineStates.execute
505186
def transition_to(state)
      ::Instana.logger.debug("Transitioning to #{state}")
      case state
      when :announced
        # announce successful; set state
        @state = :announced

        # Reset the entity timer
        @entity_last_seen = Time.now

      when :unannounced
        @state = :unannounced
        # Reset our HTTP client
        @httpclient = nil

      else
        ::Instana.logger.debug "Uknown agent state: #{state}"
      end
      ::Instana.collector.reset_timer!
      true
    end
559615
def transition(prior_state, next_state):
    
    if next_state not in STATES[prior_state][TRANSITION]:
        acceptable = STATES[prior_state][TRANSITION]
        err = "cannot {}->{} may only {}->{}".format(prior_state,
                                                     next_state,
                                                     prior_state,
                                                     acceptable)
        raise InvalidStateTransition(err)
    return next_state
969265
def transition(self, state, message=""):
        
        with self.changes_squashed:
            initial_state = self.state.value
            if self.state_set.transition_allowed(
                    initial_state=initial_state, target_state=state):
                self.log.debug(
                    "%s: Transitioning from %s to %s",
                    self.mri, initial_state, state)
                if state == ss.DISABLED:
                    alarm = Alarm.invalid("Disabled")
                elif state == ss.FAULT:
                    alarm = Alarm.major(message)
                else:
                    alarm = Alarm()
                self.update_health(self, HealthInfo(alarm))
                self.state.set_value(state)
                self.state.set_alarm(alarm)
                for child, writeable in self._children_writeable[state].items():
                    if isinstance(child, AttributeModel):
                        child.meta.set_writeable(writeable)
                    elif isinstance(child, MethodModel):
                        child.set_writeable(writeable)
            else:
                raise TypeError("Cannot transition from %s to %s" %
                                (initial_state, state))
1316386
function(state, transitionContext)
  {
    // this check is necessary to make sure we don't re-enter a transient state
    // like Renewing when we're already in it
    if (currentState !== state)
    {
      // if we have a current state, exit it; the null check is necessary
      // because the currentState is undefined at bootstrap time when we
      // transition to the first state
      if (currentState)
      {
        currentState.exit();
      }

      // update the current state
      currentState = state;

      // enter the new state
      currentState.enter(transitionContext);
    }
  }
744444
private void setState(final RunnableProcessState newState) {
    if (!this.state.isLegal(newState)) {
      throw new IllegalStateException("Transition from " + this.state + " to " + newState + " is illegal");
    }
    this.state = newState;
  }
676240
private State nextState(State currentState, int i) {
        switch (currentState) {
            case FREE_TEXT:
                return jumpFromFreeText(str, i);
            case PARAM_START:
                return jumpFromParamStart(str, i);
            case PARAM:
                return jumpFromParam(str, i);
            case PARAM_END:
                return jumpFromParamEnd(str, i);
            case ESCAPE_CHAR:
                return State.FREE_TEXT;
            // Should never go here
            default:
                throw UncheckedTemplateException.invalidStateException(currentState);
        }
    }
614047
def move(self, state):
        
        if state == tuple([ BEGIN ] * self.state_size):
            choices = self.begin_choices
            cumdist = self.begin_cumdist
        else:
            choices, weights = zip(*self.model[state].items())
            cumdist = list(accumulate(weights))
        r = random.random() * cumdist[-1]
        selection = choices[bisect.bisect(cumdist, r)]
        return selection
737100
def _post_transition(self, result, *args, **kwargs):
        """"""
        for hook in self._filter_hooks(HOOK_AFTER, HOOK_ON_ENTER):
            hook(self.instance, result, *args, **kwargs)
523312
function() {
    this._super();

    set(this, 'stateMeta', Ember.Map.create());

    var initialState = get(this, 'initialState');

    if (!initialState && get(this, 'states.start')) {
      initialState = 'start';
    }

    if (initialState) {
      this.transitionTo(initialState);
      Ember.assert('Failed to transition to initial state "' + initialState + '"', !!get(this, 'currentState'));
    }
  }
1001029
def transition!(event_name, *data, &block)
      from_state = current
      to_state   = events_map.move_to(event_name, from_state, *data)

      block.call(from_state, to_state) if block

      if log_transitions
        Logger.report_transition(event_name, from_state, to_state, *data)
      end

      try_trigger(event_name) { transition_to!(to_state) }
    end
747684
public boolean containsTransition(final TransitionableState state, final String transition) {
        if (state == null) {
            LOGGER.error("State is not configured correctly and cannot be null.");
            return false;
        }
        return state.getTransition(transition) != null;
    }