Updates the state machine context.
733
void update(long index, Instant instant, Type type) {
    this.index = index;
    this.type = type;
    clock.set(instant);
  }
1144164
void init(long index, Instant instant, ServerStateMachineContext.Type type) {
    context.update(index, instant, type);
  }
850374
def __update_state(self):
    """"""
    # Only if the job was not in a terminal state.
    if self._state.active:
      self._state = self.__get_state_by_id(self.job_config.job_id)
256055
def add_state_machine(widget, event=None):
    """"""
    logger.debug("Creating new state-machine...")
    root_state = HierarchyState("new root state")
    state_machine = StateMachine(root_state)
    rafcon.core.singleton.state_machine_manager.add_state_machine(state_machine)
176707
private void updateState(String styleDependent) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(styleDependent)) {
            // reseting to cmsState-up
            styleDependent = "up";
        }
        if (!styleDependent.equals(m_styleDependent)) {
            m_main.removeStyleDependentName(m_styleDependent);
            m_main.setStyleDependentName(styleDependent, true);
            m_styleDependent = styleDependent;
        }
    }
755335
def update(self, state, tnow):
        ''''''
        self.state = state
        self.update_time = tnow
981718
private synchronized void changeState(PrimitiveState state) {
    if (this.state != state) {
      this.state = state;
      stateChangeListeners.forEach(l -> threadContext.execute(() -> l.accept(state)));
    }
  }
546423
def update_state_changes(self, state_changes_data: List[Tuple[str, int]]) -> None:
        """"""
        cursor = self.conn.cursor()
        cursor.executemany(
            'UPDATE state_changes SET data=? WHERE identifier=?',
            state_changes_data,
        )
        self.maybe_commit()
1361201
def setup_statemachine(self):
        """"""

        machine = QtCore.QStateMachine()

        #  _______________
        # |               |
        # |               |
        # |               |
        # |_______________|
        #
        group = util.QState("group", QtCore.QState.ParallelStates, machine)

        #  _______________
        # | ____     ____ |
        # ||    |---|    ||
        # ||____|---|____||
        # |_______________| - Parallell State
        #
        visibility = util.QState("visibility", group)

        hidden = util.QState("hidden", visibility)
        visible = util.QState("visible", visibility)

        #  _______________
        # | ____     ____ |
        # ||    |---|    ||
        # ||____|---|____||
        # |_______________| - Parallell State
        #
        operation = util.QState("operation", group)

        ready = util.QState("ready", operation)

        collecting = util.QState("collecting", operation)
        validating = util.QState("validating", operation)
        extracting = util.QState("extracting", operation)
        integrating = util.QState("integrating", operation)

        finished = util.QState("finished", operation)
        repairing = util.QState("repairing", operation)
        initialising = util.QState("initialising", operation)
        stopping = util.QState("stopping", operation)
        stopped = util.QState("stopped", operation)
        saving = util.QState("saving", operation)

        #  _______________
        # | ____     ____ |
        # ||    |---|    ||
        # ||____|---|____||
        # |_______________| - Parallell State
        #
        errored = util.QState("errored", group)

        clean = util.QState("clean", errored)
        dirty = util.QState("dirty", errored)

        #  _______________
        # | ____     ____ |
        # ||    |---|    ||
        # ||____|---|____||
        # |_______________| - Parallell State

        # States that block the underlying GUI
        suspended = util.QState("suspended", group)

        alive = util.QState("alive", suspended)
        acting = util.QState("acting", suspended)
        acted = QtCore.QHistoryState(operation)
        acted.setDefaultState(ready)

        #  _______________
        # | ____     ____ |
        # ||    |---|    ||
        # ||____|---|____||
        # |_______________|
        # | ____     ____ |
        # ||    |---|    ||
        # ||____|---|____||
        # |_______________|
        #

        hidden.addTransition(self.show, visible)
        visible.addTransition(self.hide, hidden)

        ready.addTransition(self.acting, acting)
        ready.addTransition(self.validating, validating)
        ready.addTransition(self.initialising, initialising)
        ready.addTransition(self.repairing, repairing)
        ready.addTransition(self.saving, saving)
        saving.addTransition(self.saved, ready)

        collecting.addTransition(self.initialised, ready)
        collecting.addTransition(self.stopping, stopping)

        validating.addTransition(self.stopping, stopping)
        validating.addTransition(self.finished, finished)
        validating.addTransition(self.extracting, extracting)

        extracting.addTransition(self.stopping, stopping)
        extracting.addTransition(self.finished, finished)
        extracting.addTransition(self.integrating, integrating)

        integrating.addTransition(self.stopping, stopping)
        integrating.addTransition(self.finished, finished)

        finished.addTransition(self.initialising, initialising)
        finished.addTransition(self.acting, acting)
        initialising.addTransition(self.collecting, collecting)
        stopping.addTransition(self.acted, acted)
        stopping.addTransition(self.finished, finished)

        dirty.addTransition(self.initialising, clean)
        clean.addTransition(self.changed, dirty)

        alive.addTransition(self.acting, acting)
        acting.addTransition(self.acted, acted)

        # Set initial states
        for compound, state in {machine: group,
                                visibility: hidden,
                                operation: ready,
                                errored: clean,
                                suspended: alive}.items():
            compound.setInitialState(state)

        # Make connections
        for state in (hidden,
                      visible,
                      ready,
                      collecting,
                      validating,
                      extracting,
                      integrating,
                      finished,
                      repairing,
                      initialising,
                      stopping,
                      saving,
                      stopped,
                      dirty,
                      clean,
                      acting,
                      alive,
                      acted):
            state.entered.connect(
                lambda state=state: self.state_changed.emit(state.name))

        machine.start()
        return machine
676750
private void updateContext(Container c ,int maxCtx, int ctxSteps, boolean keepCustomValues)
  {

    if(!keepCustomValues)
    {
      c.removeAllItems();
    }
    
    for (Integer i : PREDEFINED_CONTEXTS)
    {
      if (i < maxCtx)
      {
        c.addItem(i);
      }
    }

    for (int step = ctxSteps; step < maxCtx; step += ctxSteps)
    {
      c.addItem(step);
    }

    c.addItem(maxCtx);

  }
980358
function JSM(context, config) {
  this.context   = context;
  this.config    = config;
  this.state     = config.init.from;
  this.observers = [context];
}
97148
public void restoreState(FacesContext context, Object state) {

        if (context == null) {
            throw new NullPointerException();
        }
        if (state == null) {
            return;
        }
        methodExpressionOneArg = (MethodExpression) ((Object[]) state)[0];
        methodExpressionZeroArg = (MethodExpression) ((Object[]) state)[1];

    }
170642
def update_execution_state_kernel(self):
        """"""
        client = self.get_current_client()
        if client is not None:
            executing = client.stop_button.isEnabled()
            self.interrupt_action.setEnabled(executing)
1008346
def update_state(self, cache=True):
        """"""
        self.use_cached_state = cache

        endpoint = API_SESAME_ENDPOINT.format(self._device_id)
        response = self.account.request('GET', endpoint)
        if response is None or response.status_code != 200:
            return

        state = json.loads(response.text)
        self._nickname = state['nickname']
        self._is_unlocked = state['is_unlocked']
        self._api_enabled = state['api_enabled']
        self._battery = state['battery']
1083752
def update_menu(self):
        """"""
        self.menu.clear()
        add_actions(self.menu, self.create_context_menu_actions())
170658
public void setState(Object context, String name, Object value) {
        StateInformation si = stateInformation.get(name);
        if (si == null) {
            si = new StateInformation();
            stateInformation.put(name, si);
        }
        si.set(context, value);
    }
842624
def update_state(self):
        
        response = self.api_interface.get_device_state(self, id_override=self.parent.object_id(),
                                                       type_override=self.parent.object_type())
        self._update_state_from_response(response)