Examples of Transition


Examples of org.apache.helix.model.Transition

    states.add("SLAVE");
    states.add("DROPPED");
    states.add("OFFLINE");

    List<Transition> transitions = new ArrayList<Transition>();
    transitions.add(new Transition("SLAVE", "OFFLINE"));
    transitions.add(new Transition("OFFLINE", "SLAVE"));
    transitions.add(new Transition("SLAVE", "MASTER"));
    transitions.add(new Transition("OFFLINE", "DROPPED"));
    transitions.add(new Transition("MASTER", "SLAVE"));

    StateTransitionTableBuilder builder = new StateTransitionTableBuilder();
    Map<String, Map<String, String>> next = builder.buildTransitionTable(states, transitions);
    System.out.println(next);
    printPath(states, next);
View Full Code Here

Examples of org.apache.lenya.cms.workflow.Transition

    /** Returns the transitions that can fire for this user.
     *
     */
    public Transition[] getExecutableTransitions(User user) {
        Situation situation = new SituationImpl(getDocument(), user);
        Transition transitions[] = getWorkflow().getLeavingTransitions(getCurrentState());
        Set executableTransitions = new HashSet();
       
        for (int i = 0; i < transitions.length; i++) {
            if (transitions[i].canFire(situation)) {
                executableTransitions.add(transitions[i]);
View Full Code Here

Examples of org.apache.lenya.workflow.Transition

    /**
     * @see org.apache.lenya.workflow.WorkflowInstance#isSynchronized(org.apache.lenya.workflow.Event)
     */
    public boolean isSynchronized(Event event) throws WorkflowException {
        Transition nextTransition = getNextTransition(event);
        return nextTransition.isSynchronized();
    }
View Full Code Here

Examples of org.apache.lucene.util.automaton.Transition

        msg.append(" INITIAL");
      }
      msg.append(a.isAccept(s) ? " [accept]" : " [reject]");
      msg.append(", "); msg.append(a.getNumTransitions(s));msg.append(" transitions");
      setString(n1, "text", msg.toString());     
      Transition t = new Transition();
      int count = a.initTransition(s, t);
      for (int i=0;i<count;i++) {
       a.getNextTransition(t);
       Object n2 = create("node");
       add(n1, n2);
       setString(n2, "text", t.toString());
     
    }
  }
View Full Code Here

Examples of org.apache.lucene.util.automaton.Transition

    State initial = new State();
    State accept = new State();
    accept.setAccept(true);
    for (int i = 0; i <= 0x10FFFF; i++) {
      if (Character.isLetter(i)) {
        initial.addTransition(new Transition(i, i, accept));
      }
    }
    Automaton single = new Automaton(initial);
    single.reduce();
    Automaton repeat = BasicOperations.repeat(single);
View Full Code Here

Examples of org.apache.lucene.util.automaton.Transition

      for(Transition t : state.getTransitions()) {
        assert t.getMin() == t.getMax();
        if (t.getMin() == TokenStreamToAutomaton.POS_SEP) {
          if (preserveSep) {
            // Remap to SEP_LABEL:
            newTransitions.add(new Transition(SEP_LABEL, t.getDest()));
          } else {
            copyDestTransitions(state, t.getDest(), newTransitions);
            a.setDeterministic(false);
          }
        } else if (t.getMin() == TokenStreamToAutomaton.HOLE) {
View Full Code Here

Examples of org.apache.lucene.util.automaton.Transition

      for(Transition t : state.getTransitions()) {
        assert t.getMin() == t.getMax();
        if (t.getMin() == TokenStreamToAutomaton.POS_SEP) {
          if (preserveSep) {
            // Remap to SEP_LABEL:
            newTransitions.add(new Transition(SEP_LABEL, t.getDest()));
          } else {
            copyDestTransitions(state, t.getDest(), newTransitions);
            a.setDeterministic(false);
          }
        } else if (t.getMin() == TokenStreamToAutomaton.HOLE) {
View Full Code Here

Examples of org.apache.openjpa.persistence.kernel.common.apps.Transition

    int getIndex(State s) {
        return Integer.parseInt(s.getName().substring(1)) - 1;
    }

    Transition newTransition(State from, State to) {
        Transition t = new Transition();
        t.setFromState(from);
        t.setToState(to);
        t.setName(from.getName()+"->"+to.getName());
        from.addOutgoingTransitions(t);
        to.addIncomingTransitions(t);
        return t;
    }
View Full Code Here

Examples of org.apache.qpid.server.store.StateManager.Transition

        return _state;
    }

    public synchronized void attainState(State desired)
    {
        Transition transition = null;
        final Map<State, Transition> stateTransitionMap = _validTransitions.get(_state);
        if(stateTransitionMap != null)
        {
            transition = stateTransitionMap.get(desired);
        }
        if(transition == null)
        {
            throw new IllegalStateException("No valid transition from state " + _state + " to state " + desired);
        }
        _state = desired;
        _eventListener.event(transition.getEvent());
    }
View Full Code Here

Examples of org.apache.shale.dialog.basic.model.Transition

        State current = position.getState();
        String fromStateId = current.getName();

        // Select the next state based on the specified outcome
        Transition transition = current.findTransition(outcome);
        if (transition == null) {
            transition = position.getDialog().findTransition(outcome);
        }
        if (transition == null) {
            throw new IllegalStateException
              ("Cannot find transition '" + outcome
               + "' for state '" + fromStateId
               + "' of dialog '" + position.getDialog().getName() + "'");
        }
        State next = position.getDialog().findState(transition.getTarget());
        if (next == null) {
            throw new IllegalStateException
              ("Cannot find state '" + transition.getTarget()
               + "' for dialog '" + position.getDialog().getName() + "'");
        }
        String toStateId = next.getName();
        position.setState(next);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.