Package org.activiti.engine.delegate.event.impl

Examples of org.activiti.engine.delegate.event.impl.ActivitiEventImpl


   
    // Clear any events received (eg. engine initialisation)
    listener.clearEventsReceived();
   
    // Dispath a custom event
    ActivitiEvent event = new ActivitiEventImpl(ActivitiEventType.CUSTOM);
    processEngineConfiguration.getEventDispatcher().dispatchEvent(event);
   
    assertEquals(1, listener.getEventsReceived().size());
    assertEquals(event, listener.getEventsReceived().get(0));
  }
View Full Code Here


   
    // Clear any events received (eg. engine initialisation)
    listener.clearEventsReceived();
   
    // Dispath a custom event
    ActivitiEvent event = new ActivitiEventImpl(ActivitiEventType.CUSTOM);
    processEngineConfiguration.getEventDispatcher().dispatchEvent(event);
   
    assertEquals(1, listener.getEventsReceived().size());
    assertEquals(event, listener.getEventsReceived().get(0));
    listener.clearEventsReceived();
   
    // Dispatch another event the listener is registered for
    event = new ActivitiEventImpl(ActivitiEventType.ENTITY_DELETED);
     processEngineConfiguration.getEventDispatcher().dispatchEvent(event);
     event = new ActivitiEventImpl(ActivitiEventType.ENTITY_UPDATED);
     processEngineConfiguration.getEventDispatcher().dispatchEvent(event);
    
     assertEquals(2, listener.getEventsReceived().size());
     assertEquals(ActivitiEventType.ENTITY_DELETED, listener.getEventsReceived().get(0).getType());
     assertEquals(ActivitiEventType.ENTITY_UPDATED, listener.getEventsReceived().get(1).getType());
     listener.clearEventsReceived();
   
    // Dispatch an event that is NOT part of the types configured
    event = new ActivitiEventImpl(ActivitiEventType.ENTITY_CREATED);
    processEngineConfiguration.getEventDispatcher().dispatchEvent(event);
    assertTrue(listener.getEventsReceived().isEmpty());
  }
View Full Code Here

    TestActivitiEventListener secondListener = new TestActivitiEventListener();

    dispatcher.addEventListener(listener);
    dispatcher.addEventListener(secondListener);

    ActivitiEventImpl event = new ActivitiEventImpl(ActivitiEventType.ENTITY_CREATED);
    try {
      dispatcher.dispatchEvent(event);
      assertEquals(1, secondListener.getEventsReceived().size());
    } catch (Throwable t) {
      fail("No exception expected");
View Full Code Here

TOP

Related Classes of org.activiti.engine.delegate.event.impl.ActivitiEventImpl

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.