Examples of DecisionHandler


Examples of org.jbpm.api.jpdl.DecisionHandler

  public void execute(ExecutionImpl execution) {
    Activity activity = execution.getActivity();
   
    String transitionName = null;

    DecisionHandler usedDecisionHandler = null;
    if (decisionHandler!=null) {
      usedDecisionHandler = decisionHandler;
     
    } else if (decisionHandlerName!=null) {
      Environment environment = Environment.getCurrent();
      Object object = environment.get(decisionHandlerName);
      if (object==null) {
        throw new JbpmException("decision handler for "+activity+" is null");
      }
      if (! (object instanceof DecisionHandler)) {
        throw new JbpmException("handler for decision is not a "+DecisionHandler.class.getName()+": "+object.getClass().getName());
      }
      usedDecisionHandler = (DecisionHandler) object;
    } else {
      throw new JbpmException("no decision handler specified");
    }
   
    transitionName = usedDecisionHandler.decide(execution);

    Transition transition = activity.getOutgoingTransition(transitionName);
    if (transition==null) {
      throw new JbpmException("handler in decision '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
    }
View Full Code Here

Examples of org.jbpm.api.jpdl.DecisionHandler

    Element handlerElement = XmlUtil.element(element, "handler");
    if (handlerElement!=null) {
      DecisionHandlerActivity decisionHandlerActivity = new DecisionHandlerActivity();
      ObjectDescriptor decisionHandlerDescriptor = (ObjectDescriptor)
          objectBinding.parse(handlerElement, parse, wireParser);
      DecisionHandler decisionHandler = (DecisionHandler) WireContext.create(decisionHandlerDescriptor);
      decisionHandlerActivity.setDecisionHandler(decisionHandler);
      return decisionHandlerActivity;
    }
   
    boolean hasConditions = false;
View Full Code Here

Examples of org.jbpm.api.jpdl.DecisionHandler

  public void execute(ExecutionImpl execution) {
    Activity activity = execution.getActivity();
   
    String transitionName = null;

    DecisionHandler decisionHandler = null;
   
    if (decisionHandlerReference!=null) {
      decisionHandler = (DecisionHandler) decisionHandlerReference.getObject(execution);
    }
   
    if (decisionHandler==null) {
      throw new JbpmException("no decision handler specified");
    }
   
    transitionName = decisionHandler.decide(execution);

    Transition transition = activity.getOutgoingTransition(transitionName);
    if (transition==null) {
      throw new JbpmException("handler in decision '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
    }
View Full Code Here

Examples of org.jbpm.graph.node.DecisionHandler

  /**
   * @see org.jbpm.graph.node.DecisionHandler#decide(org.jbpm.graph.exe.ExecutionContext)
   */
  public String decide(ExecutionContext executionContext) throws Exception {
    DecisionHandler handler = (DecisionHandler) lookupBean(DecisionHandler.class);
    if (logger.isDebugEnabled())
      logger.debug("using Spring-managed decisionHandler=" + handler);
    return handler.decide(executionContext);
  }
View Full Code Here

Examples of org.jbpm.graph.node.DecisionHandler

  /**
   * @see org.jbpm.graph.node.DecisionHandler#decide(org.jbpm.graph.exe.ExecutionContext)
   */
  public String decide(ExecutionContext executionContext) throws Exception {
    DecisionHandler handler = (DecisionHandler) lookupBean(DecisionHandler.class);
    if (logger.isDebugEnabled())
      logger.debug("using Spring-managed decisionHandler=" + handler);
    return handler.decide(executionContext);
  }
View Full Code Here

Examples of org.jbpm.graph.node.DecisionHandler

    public void execute(NodeInstance from, String type) {
      String transitionName = null;
      try {
        Delegation decisionDelegation = getDecision().getDecisionDelegation();
        if (decisionDelegation != null) {
          DecisionHandler decisionHandler = (DecisionHandler) decisionDelegation.instantiate();
          transitionName = decisionHandler.decide(new JpdlExecutionContext());
        } else if (getDecision().getDecisionExpression() != null) {
          String decisionExpression = getDecision().getDecisionExpression();
          Object result = JbpmExpressionEvaluator.evaluate(
          decisionExpression, new JpdlExecutionContext());
          if (result == null) {
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.