Class ActivitiEventDispatcherImpl

java.lang.Object
org.activiti.engine.delegate.event.impl.ActivitiEventDispatcherImpl
All Implemented Interfaces:
ActivitiEventDispatcher

public class ActivitiEventDispatcherImpl extends Object implements ActivitiEventDispatcher
Class capable of dispatching events.
  • Field Details

  • Constructor Details

    • ActivitiEventDispatcherImpl

      public ActivitiEventDispatcherImpl()
  • Method Details

    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface ActivitiEventDispatcher
      Parameters:
      enabled - true, if event dispatching should be enabled.
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface ActivitiEventDispatcher
      Returns:
      true, if event dispatcher is enabled.
    • addEventListener

      public void addEventListener(ActivitiEventListener listenerToAdd)
      Description copied from interface: ActivitiEventDispatcher
      Adds an event-listener which will be notified of ALL events by the dispatcher.
      Specified by:
      addEventListener in interface ActivitiEventDispatcher
      Parameters:
      listenerToAdd - the listener to add
    • addEventListener

      public void addEventListener(ActivitiEventListener listenerToAdd, ActivitiEventType... types)
      Description copied from interface: ActivitiEventDispatcher
      Adds an event-listener which will only be notified when an event of the given types occurs.
      Specified by:
      addEventListener in interface ActivitiEventDispatcher
      Parameters:
      listenerToAdd - the listener to add
      types - types of events the listener should be notified for
    • removeEventListener

      public void removeEventListener(ActivitiEventListener listenerToRemove)
      Description copied from interface: ActivitiEventDispatcher
      Removes the given listener from this dispatcher. The listener will no longer be notified, regardless of the type(s) it was registered for in the first place.
      Specified by:
      removeEventListener in interface ActivitiEventDispatcher
      Parameters:
      listenerToRemove - listener to remove
    • dispatchEvent

      public void dispatchEvent(ActivitiEvent event)
      Description copied from interface: ActivitiEventDispatcher
      Dispatches the given event to any listeners that are registered.
      Specified by:
      dispatchEvent in interface ActivitiEventDispatcher
      Parameters:
      event - event to dispatch.
    • extractBpmnModelFromEvent

      protected org.activiti.bpmn.model.BpmnModel extractBpmnModelFromEvent(ActivitiEvent event)
      In case no process-context is active, this method attempts to extract a process-definition based on the event. In case it's an event related to an entity, this can be deducted by inspecting the entity, without additional queries to the database. If not an entity-related event, the process-definition will be retrieved based on the processDefinitionId (if filled in). This requires an additional query to the database in case not already cached. However, queries will only occur when the definition is not yet in the cache, which is very unlikely to happen, unless evicted.
      Parameters:
      event -
      Returns: