Examples of Transition


Examples of org.jbpm.graph.def.Transition

      decisionDelegation.read(decisionHandlerElement, jpdlReader);
    }
  }

  public void execute(ExecutionContext executionContext) {
    Transition transition = null;

    // set context class loader correctly for delegation class
    // (https://jira.jboss.org/jira/browse/JBPM-1448)
    Thread currentThread = Thread.currentThread();
    ClassLoader contextClassLoader = currentThread.getContextClassLoader();
    currentThread.setContextClassLoader(JbpmConfiguration.getProcessClassLoader(executionContext.getProcessDefinition()));

    try {
      if (decisionDelegation != null) {
        DecisionHandler decisionHandler = (DecisionHandler) decisionDelegation.getInstance();
        if (decisionHandler == null)
          decisionHandler = (DecisionHandler) decisionDelegation.instantiate();

        String transitionName = decisionHandler.decide(executionContext);
        transition = getLeavingTransition(transitionName);
        if (transition == null) {
          throw new JbpmException("decision '"
              + name
              + "' selected non existing transition '"
              + transitionName
              + "'");
        }
      }
      else if (decisionExpression != null) {
        Object result = JbpmExpressionEvaluator.evaluate(decisionExpression, executionContext);
        if (result == null) {
          throw new JbpmException("decision expression '" + decisionExpression + "' returned null");
        }
        String transitionName = result.toString();
        transition = getLeavingTransition(transitionName);
        if (transition == null) {
          throw new JbpmException("decision '"
              + name
              + "' selected non existing transition '"
              + transitionName
              + "'");
        }
      }
      else if (decisionConditions != null && !decisionConditions.isEmpty()) {
        // backwards compatible mode based on separate DecisionCondition's
        for (DecisionCondition decisionCondition : decisionConditions) {
          Object result = JbpmExpressionEvaluator.evaluate(decisionCondition.getExpression(),
              executionContext);
          if (Boolean.TRUE.equals(result)) {
            String transitionName = decisionCondition.getTransitionName();
            transition = getLeavingTransition(transitionName);
            if (transition != null) break;
          }
        }
      }
      else {
        // new mode based on conditions in the transition itself
        for (Transition candidate : leavingTransitions) {
          String conditionExpression = candidate.getCondition();
          if (conditionExpression != null) {
            Object result = JbpmExpressionEvaluator.evaluate(conditionExpression, executionContext);
            if (Boolean.TRUE.equals(result)) {
              transition = candidate;
              break;
            }
          }
        }
      }
    }
    catch (Exception exception) {
      raiseException(exception, executionContext);
      if (!equals(executionContext.getNode())) {
        return;
      }
    }
    finally {
      currentThread.setContextClassLoader(contextClassLoader);
    }

    if (transition == null) {
      transition = getDefaultLeavingTransition();

      if (transition == null)
        throw new JbpmException("decision cannot select transition: " + this);

      log.debug("decision did not select transition, taking default " + transition);
    }

    // since the decision node evaluates condition expressions, the condition of the
    // taken transition will always be met. therefore we can safely turn off
    // the standard condition enforcement in the transitions after a decision node.
    transition.removeConditionEnforcement();

    log.debug("decision '" + name + "' is taking " + transition);
    executionContext.leaveNode(transition);
  }
View Full Code Here

Examples of org.jbpm.graph.def.Transition

  public void signal(String transitionName)
  {
    if (node == null)
      throw new JbpmException("token '" + this + "' can't be signalled cause it is currently not positioned in a node");
   
    Transition leavingTransition = node.getLeavingTransition(transitionName);
   
    if (leavingTransition == null)
    {
      // Fall back to the name of the target node
      for (Transition auxTrans : node.getLeavingTransitions())
View Full Code Here

Examples of org.jbpm.graph.def.Transition

    for ( int i = 0; i < transitions.length; i++ ) {
      String[] parsedTransition = cutTransitionText( transitions[i] );
      Node from = pd.getNode( parsedTransition[0] );
      Node to = pd.getNode( parsedTransition[2] );
      Transition t = new Transition( parsedTransition[1] );
      from.addLeavingTransition(t);
      to.addArrivingTransition(t);
    }
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.model.Transition

    DbSession taskDbSession = Environment
        .getFromCurrent(DbSession.class);
    TaskImpl task = (TaskImpl) taskDbSession.findTaskByExecution(execution);
    task.setSignalling(false);
   
    Transition transition = null;
    List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
    if ( (outgoingTransitions!=null)
         && (!outgoingTransitions.isEmpty())
       ) {
      transition = activity.findOutgoingTransition(signalName);
View Full Code Here

Examples of org.jbpm.ui.common.model.Transition

        }
    }
   
    @Override
    protected void refreshVisuals() {
        Transition transition = getModel();
        if (transition.getSource() instanceof TaskState && !PluginConstants.TIMER_TRANSITION_NAME.equals(transition.getName())) {
            String label;
            if (((TaskState) transition.getSource()).hasMultipleOutputTransitions()) {
                label = transition.getName();
            } else {
                label = "";
            }
            getFigure().setLabelText(label);
        }
        if (transition.getSource() instanceof ActionNode){
            String label;
            if (transition.getSource().getLeavingTransitions().size() > 1) {
                label = transition.getName();
            } else {
                label = "";
            }
            getFigure().setLabelText(label);
        }
View Full Code Here

Examples of org.jets3t.service.model.LifecycleConfig.Transition

        }

        // Transition/Expiration section

        public void startTransition() {
            latestTimeEvent = config.new Transition();
            latestRule.setTransition(((Transition)latestTimeEvent));
        }
View Full Code Here

Examples of org.omg.uml.behavioralelements.statemachines.Transition

    /**
     * @see org.andromda.metafacades.uml.EventFacade#getTransition()
     */
    protected Object handleGetTransition()
    {
        Transition eventTransition = null;

        final Collection allTransitions =
            UML14MetafacadeUtils.getModel().getStateMachines().getTransition().refAllOfType();
        for (final Iterator iterator = allTransitions.iterator(); iterator.hasNext() && eventTransition == null;)
        {
            final Transition transition = (Transition)iterator.next();
            if (metaObject.equals(transition.getTrigger()))
            {
                eventTransition = transition;
            }
        }

View Full Code Here

Examples of org.omg.uml.behavioralelements.statemachines.Transition

        super(metaObject, context);
    }

    protected Object handleGetTransition()
    {
        Transition effectTransition = null;

        final Collection allTransitions = UML14MetafacadeUtils.getModel().getStateMachines().getTransition().refAllOfType();
        for (final Iterator iterator = allTransitions.iterator(); iterator.hasNext() && effectTransition == null;)
        {
            Transition transition = (Transition)iterator.next();
            if (metaObject.equals(transition.getEffect()))
            {
                effectTransition = transition;
            }
        }
View Full Code Here

Examples of org.pdfclown.documents.interaction.navigation.page.Transition

    )
  {
    /*
      NOTE: 'Trans' entry MUST exist.
    */
    return new Transition(getBaseDataObject().get(PdfName.Trans),getContainer());
  }
View Full Code Here

Examples of org.pdfclown.documents.interaction.navigation.page.Transition

    int transitionStylesLength = transitionStyles.length;
    for(Page page : document.getPages())
    {
      // Apply a transition to the page!
      page.setTransition(
        new Transition(
          document,
          transitionStyles[(int)(Math.random()*((double)transitionStylesLength))], // NOTE: Random selection of the transition is done here just for demonstrative purposes; in real world, you would obviously choose only the appropriate enumeration constant among those available.
          Float.valueOf(.5f) // Transition duration (half a second).
          )
        );
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.