Package org.jbpm.pvm.internal.model

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


         || (eventListenerReferences.isEmpty())
       ) {
      return false;
    }

    EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
    return eventListenerReference.isAsync();
  }
View Full Code Here


    int eventListenerIndex = execution.getEventListenerIndex();
    List<EventListenerReference> eventListenerReferences = event.getListenerReferences();
    if ( (eventListenerReferences!=null)
         && (!eventListenerReferences.isEmpty())
       ) {
      EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
      ObservableElement eventSource = execution.getEventSource();
      if ((eventSource == observableElement) || (eventListenerReference.isPropagationEnabled())) {
        EventListener eventListener = eventListenerReference.get();
        log.trace("executing " + eventListener + " for " + event);
        try {
          // TODO can/should this invocation be unified with the exception handler invocation of the event notification method?
          eventListener.notify(execution);
        } catch (Exception e) {
View Full Code Here

  protected void addListener(EventListener eventListener) {
    getEvent().createEventListenerReference(eventListener);
  }

  protected void addListener(EventListener eventListener, boolean propagation) {
    EventListenerReference eventListenerReference = getEvent().createEventListenerReference(eventListener);
    eventListenerReference.setPropagationEnabled(propagation);
  }
View Full Code Here

  protected void addListener(Descriptor descriptor) {
    getEvent().createEventListenerReference(descriptor);
  }

  protected void addListener(Descriptor descriptor, boolean propagation) {
    EventListenerReference eventListenerReference = getEvent().createEventListenerReference(descriptor);
    eventListenerReference.setPropagationEnabled(propagation);
  }
View Full Code Here

  protected void addListener(String expression) {
    getEvent().createEventListenerReference(expression);
  }

  protected void addListener(String expression, boolean propagation) {
    EventListenerReference eventListenerReference = getEvent().createEventListenerReference(expression);
    eventListenerReference.setPropagationEnabled(propagation);
  }
View Full Code Here

      for (Element eventListenerElement: XmlUtil.elements(element)) {
        JpdlBinding eventBinding = (JpdlBinding) getBinding(eventListenerElement, CATEGORY_EVENT_LISTENER);
        if (eventBinding!=null) {
          EventListener eventListener = (EventListener) eventBinding.parse(eventListenerElement, parse, this);
          EventListenerReference eventListenerReference = event.createEventListenerReference(eventListener);
         
          if (XmlUtil.attributeBoolean(eventListenerElement, "propagation", false, parse, false)) {
            eventListenerReference.setPropagationEnabled(true);
          }
         
          continuationText = XmlUtil.attribute(eventListenerElement, "continue");
          if (continuationText!=null) {
            if (observableElement instanceof ActivityImpl) {
              if (observableElement.getName()==null) {
                parse.addProblem("async continuation on event listener requires activity name", eventListenerElement);
              }
            } else if (observableElement instanceof TransitionImpl) {
              TransitionImpl transition = (TransitionImpl) observableElement;
              if (transition.getSource().getName()==null) {
                parse.addProblem("async continuation on event listener requires name in the transition source activity", eventListenerElement);
              }
            }
            if ("async".equals(continuationText)) {
              eventListenerReference.setContinuation(Continuation.ASYNCHRONOUS);
            } else if ("exclusive".equals(continuationText)) {
              eventListenerReference.setContinuation(Continuation.EXCLUSIVE);
            }
          }

        } else {
          String tagName = XmlUtil.getTagLocalName(eventListenerElement);
View Full Code Here

    if (event == null) {
      event = observableElement.createEvent(eventName);
    }
    // register event listener
    MailListener eventListener = new MailListener();
    EventListenerReference eventListenerRef = event.createEventListenerReference(eventListener);
    // set continuation mode
    String continuationText = XmlUtil.attribute(element, "continue");
    if ("async".equals(continuationText)) {
      eventListenerRef.setContinuation(Continuation.ASYNCHRONOUS);
    }
    else if ("exclusive".equals(continuationText)) {
      eventListenerRef.setContinuation(Continuation.EXCLUSIVE);
    }
    // associate mail producer to event listener
    MailProducer mailProducer = parseMailProducer(element, parse, "task-notification");
    eventListener.setMailProducer(mailProducer);
  }
View Full Code Here

         || (eventListenerReferences.isEmpty())
       ) {
      return false;
    }

    EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
    return eventListenerReference.isAsync();
  }
View Full Code Here

    int eventListenerIndex = execution.getEventListenerIndex();
    List<EventListenerReference> eventListenerReferences = event.getListenerReferences();
    if ( (eventListenerReferences!=null)
         && (!eventListenerReferences.isEmpty())
       ) {
      EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
      ObservableElement eventSource = execution.getEventSource();
      if ((eventSource == observableElement) || (eventListenerReference.isPropagationEnabled())) {
        EventListener eventListener = eventListenerReference.getEventListener();
        log.trace("executing " + eventListener + " for " + event);
        try {
          // TODO can/should this invocation be unified with the exception handler invocation of the event notification method?
          eventListener.notify(execution);
        } catch (Exception e) {
View Full Code Here

  protected void addListener(EventListener eventListener) {
    getEvent().createEventListenerReference(eventListener);
  }

  protected void addListener(EventListener eventListener, boolean propagation) {
    EventListenerReference eventListenerReference = getEvent().createEventListenerReference(eventListener);
    eventListenerReference.setPropagationEnabled(propagation);
  }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.model.EventListenerReference

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.