Package org.jbpm

Examples of org.jbpm.PvmException


  /** ends a block in which nested nodes are created.
   * This method requires that a nested node block was started before
   * with {@link #compositeNode(String)} */
  public ProcessFactory compositeEnd() {
    if (exceptionHandler!=null) {
      throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
    }

    if (compositeElementStack==null) {
      throw new PvmException("no composite node was started");
    }

    compositeElement = compositeElementStack.pop();
   
    if (compositeElementStack.isEmpty()) {
View Full Code Here


  public ProcessFactory transition(String transitionName) {
    if (exceptionHandler!=null) {
      exceptionHandler.setTransitionName(transitionName);
    } else {
      if (node==null) {
        throw new PvmException("no current node");
      }
      transition = node.createOutgoingTransition(null, transitionName);
      observableElement = transition;
      event = null;
      eventListenerReference = null;
View Full Code Here

  /** sets the takeAsync property on the current transition
   * This method requires a current transition. */
  public ProcessFactory asyncTake() {
    if (exceptionHandler!=null) {
      throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
    }
    if (transition==null) {
      throw new PvmException("no current transition");
    }
    transition.setTakeAsync(true);
    return this;
  }
View Full Code Here

  /** sets the destination node on the current transition.
   * This method requires a current transition. */
  public ProcessFactory to(String destination) {
    if (exceptionHandler!=null) {
      throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
    }
    if (transition==null) {
      throw new PvmException("no current transition");
    }
    if (destinationReferences==null) {
      destinationReferences = new ArrayList<DestinationReference>();
    }
    destinationReferences.add(new DestinationReference(transition, destination));
View Full Code Here

  /** sets the wait condition on the current transition.
   * This method requires a current transition. */
  public ProcessFactory waitCondition(Condition condition) {
    if (exceptionHandler!=null) {
      throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
    }
    if (transition==null) {
      throw new PvmException("no current transition");
    }
    ObjectReference<Condition> waitConditionReference = new ObjectReference<Condition>(condition);
    transition.setWaitConditionReference(waitConditionReference);
    return this;
  }
View Full Code Here

  /** sets the guard condition on the current transition.
   * This method requires a current transition. */
  public ProcessFactory guardCondition(Condition condition) {
    if (exceptionHandler!=null) {
      throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
    }
    if (transition==null) {
      throw new PvmException("no current transition");
    }
    ObjectReference<Condition> guardConditionReference = new ObjectReference<Condition>(condition);
    transition.setGuardConditionReference(guardConditionReference);
    return this;
  }
View Full Code Here

   * called for transitions. If you have exception handlers and listeners
   * on an event, make sure that you put the invocations of
   * {@link #exceptionHandler(Class)} first. */
  public ProcessFactory event(String eventName) {
    if (exceptionHandler!=null) {
      throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
    }
    if (observableElement==null) {
      throw new PvmException("no current process element");
    }
    if (observableElement instanceof Transition) {
      throw new PvmException("for actions on transitions, you don't need to call event");
    }
    event = observableElement.createEvent(eventName);
    exceptionHandler = null;
    return this;
  }
View Full Code Here

   * have the created exception handler as a target.
   *
   * DONT'T FORGET TO CLOSE THE EXCEPTION HANDLER WITH exceptionHandlerEnd. */
  public ProcessFactory exceptionHandler(Class<? extends Exception> exceptionClass) {
    if (exceptionHandler!=null) {
      throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
    }
   
    ProcessElementImpl processElement = null;
    if (eventListenerReference!=null) {
      processElement = eventListenerReference;
    } else if (event!=null) {
      processElement = event;
    } else if (observableElement!=null) {
      processElement = observableElement;
    } else {
      throw new PvmException("no current process element, event or action");
    }
   
    exceptionHandler = processElement.createExceptionHandler();

    if (exceptionClass!=null) {
View Full Code Here

    return this;
  }
 
  public ProcessFactory transactional() {
    if (exceptionHandler==null) {
      throw new PvmException("transactional is a property of an exception handler");
    }
    exceptionHandler.setTransactional(true);
    return this;
  }
View Full Code Here

   * if the event is fired on the actual process element of the event.  The current
   * action will not be executed if an event is fired on one of the children of the
   * process element to which this event relates. */
  public ProcessFactory propagationDisabled() {
    if (exceptionHandler!=null) {
      throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
    }
    if (eventListenerReference==null) {
      throw new PvmException("no current event action");
    }
    eventListenerReference.setPropagationEnabled(false);
    return this;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.PvmException

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.