Perform a transition if it has not already been applied, and record that it was applied.
971946
public void transition (Class<?> clazz, String name, Transition trans)
        throws PersistenceException
    {
        if (!isTransitionApplied(clazz, name) && noteTransition(clazz, name)) {
            try {
                trans.run();

            } catch (PersistenceException e) {
                try {
                    clearTransition(clazz, name);
                } catch (PersistenceException pe) {
                    log.warning("Failed to clear failed transition", "class", clazz, "name", name,
                                pe);
                }
                throw e;

            } catch (RuntimeException rte) {
                try {
                    clearTransition(clazz, name);
                } catch (PersistenceException pe) {
                    log.warning("Failed to clear failed transition", "class", clazz, "name", name,
                                pe);
                }
                throw rte;
            }
        }
    }
207632
def on_failure(object, *args)
      state = machine.states.match!(object)
      machine.invalidate(object, :state, :invalid_transition, [[:event, human_name(object.class)], [:state, state.human_name(object.class)]])

      transition = Transition.new(object, machine, name, state.name, state.name)
      transition.args = args if args.any?
      transition.run_callbacks(:before => false)
    end
286268
def apply_cut(self, cut):
        """"""
        return Transition(self.network, self.before_state, self.after_state,
                          self.cause_indices, self.effect_indices, cut)
991244
def transition_to_execute(self):
        """"""
        assert self.state in [AQStateMachineStates.add]
        self.state = AQStateMachineStates.execute
241708
public function onBeforeWrite()
    {
        // Prepare blank manipulation
        $manipulations = new AssetManipulationList();

        // Mark overwritten object as deleted
        if ($this->owner->isInDB()) {
            $priorRecord = DataObject::get(get_class($this->owner))->byID($this->owner->ID);
            if ($priorRecord) {
                $this->addAssetsFromRecord($manipulations, $priorRecord, AssetManipulationList::STATE_DELETED);
            }
        }

        // Add assets from new record with the correct visibility rules
        $state = $this->getRecordState($this->owner);
        $this->addAssetsFromRecord($manipulations, $this->owner, $state);

        // Whitelist assets that exist in other stages
        $this->addAssetsFromOtherStages($manipulations);

        // Apply visibility rules based on the final manipulation
        $this->processManipulation($manipulations);
    }
709581
def append_transition(self, symbol, targetset):
        """"""
        if symbol in self.transitions:
            return
        self.transitions[symbol] = targetset
885972
def transition_to_rollback_complete(self):
        """"""
        assert self.state in [AQStateMachineStates.rollback]
        self.state = AQStateMachineStates.rollback_complate
485172
def has_transition(self, state):
        
        if state in self.transitions:
            return True

        if '*' in self.transitions:
            return True

        if '+' in self.transitions and self.transitions['+'].target != state:
            return True

        return False
180458
def is_valid_transition(self, source: str, dest: str) -> bool:
        
        if dest not in self._states or source not in self._states:
            raise NotValidState
        elif dest not in self._transitions[source]:
            raise NotValidTransition
        return True
932912
function(moveData) {
            var self            = this,
                transitionRules = [],
                transformValues = [],
                isResizing      = self.mixer.config.animation.animateResizeTargets,
                isFading        = typeof self.mixer.effectsIn.opacity !== 'undefined';

            self.callActions('beforeApplyStylesOut', arguments);

            // Build the transition rules

            transitionRules.push(self.writeTransitionRule(
                mixitup.features.transformRule,
                moveData.staggerIndex
            ));

            if (moveData.statusChange !== 'none') {
                transitionRules.push(self.writeTransitionRule(
                    'opacity',
                    moveData.staggerIndex,
                    moveData.duration
                ));
            }

            if (isResizing) {
                transitionRules.push(self.writeTransitionRule(
                    'width',
                    moveData.staggerIndex,
                    moveData.duration
                ));

                transitionRules.push(self.writeTransitionRule(
                    'height',
                    moveData.staggerIndex,
                    moveData.duration
                ));

                transitionRules.push(self.writeTransitionRule(
                    'margin',
                    moveData.staggerIndex,
                    moveData.duration
                ));
            }

            // If no callback was provided, the element will
            // not transition in any way so tag it as "immovable"

            if (!moveData.callback) {
                self.mixer.targetsImmovable++;

                if (self.mixer.targetsMoved === self.mixer.targetsImmovable) {
                    // If the total targets moved is equal to the
                    // number of immovable targets, the operation
                    // should be considered finished

                    self.mixer.cleanUp(moveData.operation);
                }

                return;
            }

            // If the target will transition in some fasion,
            // assign a callback function

            self.operation = moveData.operation;
            self.callback = moveData.callback;

            // As long as the target is not excluded, increment
            // the total number of targets bound

            !self.isExcluded && self.mixer.targetsBound++;

            // Tag the target as bound to differentiate from transitionEnd
            // events that may come from stylesheet driven effects

            self.isBound = true;

            // Apply the transition

            self.applyTransition(transitionRules);

            // Apply width, height and margin negation

            if (isResizing && moveData.posOut.width > 0 && moveData.posOut.height > 0) {
                self.dom.el.style.width        = moveData.posOut.width + 'px';
                self.dom.el.style.height       = moveData.posOut.height + 'px';
                self.dom.el.style.marginRight  = moveData.posOut.marginRight + 'px';
                self.dom.el.style.marginBottom = moveData.posOut.marginBottom + 'px';
            }

            if (!self.mixer.config.animation.nudge && moveData.statusChange === 'hide') {
                // If we're not nudging, the translation should be
                // applied before any other transforms to prevent
                // lateral movement

                transformValues.push('translate(' + moveData.posOut.x + 'px, ' + moveData.posOut.y + 'px)');
            }

            // Apply fade

            switch (moveData.statusChange) {
                case 'hide':
                    isFading && (self.dom.el.style.opacity = self.mixer.effectsOut.opacity);

                    transformValues = transformValues.concat(self.mixer.transformOut);

                    break;
                case 'show':
                    isFading && (self.dom.el.style.opacity = 1);
            }

            if (
                self.mixer.config.animation.nudge ||
                (!self.mixer.config.animation.nudge && moveData.statusChange !== 'hide')
            ) {
                // Opposite of above - apply translate after
                // other transform

                transformValues.push('translate(' + moveData.posOut.x + 'px, ' + moveData.posOut.y + 'px)');
            }

            // Apply transforms

            self.dom.el.style[mixitup.features.transformProp] = transformValues.join(' ');

            self.callActions('afterApplyStylesOut', arguments);
        }
961235
function() {
        var done = true,
            anim;
        for (anim in Transition._running) {
            if (Transition._running[anim]._runFrame) {
                done = false;
                Transition._running[anim]._runFrame();
            }
        }

        if (done) {
            Transition._stopTimer();
        }
    }
1184531
public synchronized void transitionEvent(boolean isEmpty)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "transitionEvent", new Object[]{ new Boolean(isEmpty)});

    if(isEmpty)
    {
      transition--;
    }
    else
    {
      transition++;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "transitionEvent", new Integer(transition));
  }
781926
def recently_walked?(transition)
        transitions = self
        if @target && @target != to_name && target_transition = detect {|t| t.to_name == @target}
          transitions = transitions[index(target_transition) + 1..-1]
        end
        transitions.include?(transition)
      end
702122
private void transitionToFinalBatchStatus() {
        StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
        synchronized (stopLock) {
            BatchStatus currentBatchStatus = runtimeStepExecution.getBatchStatus();
            if (currentBatchStatus.equals(BatchStatus.STARTED)) {
                updateStepBatchStatus(BatchStatus.COMPLETED);
            } else if (currentBatchStatus.equals(BatchStatus.STOPPING)) {
                updateStepBatchStatus(BatchStatus.STOPPED);
            } else if (currentBatchStatus.equals(BatchStatus.FAILED)) {
                updateStepBatchStatus(BatchStatus.FAILED); // Should have already been done but maybe better for possible code refactoring to have it here.
            } else {
                throw new IllegalStateException("Step batch status should not be in a " + currentBatchStatus.name() + " state");
            }
        }
    }
341022
public void prevStep() {
        if (currentStepIndex > 0) {
            Widget w = getWidget(currentStepIndex);
            if (w instanceof MaterialStep) {
                MaterialStep step = (MaterialStep) w;
                step.setActive(false);

                // prev step
                int prevStepIndex = getWidgetIndex(step) - 1;
                if (prevStepIndex >= 0) {
                    for (int i = prevStepIndex; i >= 0; i--) {
                        w = getWidget(i);
                        if (!(w instanceof MaterialStep)) {
                            continue;
                        }
                        MaterialStep prevStep = (MaterialStep) w;
                        if (prevStep.isEnabled() && prevStep.isVisible()) {
                            prevStep.setActive(true);
                            setCurrentStepIndex(i);
                            PreviousEvent.fire(MaterialStepper.this);
                            break;
                        }
                    }
                }
            }
        } else {
            GWT.log("You have reached the minimum step.");
        }
    }
1212791
def record_change(record, action)
      # skip unless something has actually changed
      return if action == :update && record.previous_changes.empty?
      # dispatch the record change to all known strategies
      @strategy_by_attribute.values.each { |strategy| strategy.record_change(record, action) }
    end
281221
def add_transition(self, output,
                       probability_func=lambda index: np.ones(len(index), dtype=float),
                       triggered=Trigger.NOT_TRIGGERED):
        
        t = Transition(self, output, probability_func=probability_func, triggered=triggered)
        self.transition_set.append(t)
        return t