Package org.jbpm.api.jpdl

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


    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

  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

TOP

Related Classes of org.jbpm.api.jpdl.DecisionHandler

Copyright © 2018 www.massapicom. 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.