Class BaseEntityEventListener

java.lang.Object
org.activiti.engine.delegate.event.BaseEntityEventListener
All Implemented Interfaces:
ActivitiEventListener
Direct Known Subclasses:
DebugInfoEntityEventListener

public class BaseEntityEventListener extends Object implements ActivitiEventListener
Base event listener that can be used when implementing an ActivitiEventListener to get notified when an entity is created, updated, deleted or if another entity-related event occurs. Override the onXX(..) methods to respond to entity changes accordingly.
  • Field Details

    • failOnException

      protected boolean failOnException
    • entityClass

      protected Class<?> entityClass
  • Constructor Details

    • BaseEntityEventListener

      public BaseEntityEventListener()
      Create a new BaseEntityEventListener, notified when an event that targets any type of entity is received. Returning true when isFailOnException() is called.
    • BaseEntityEventListener

      public BaseEntityEventListener(boolean failOnException)
      Create a new BaseEntityEventListener.
      Parameters:
      failOnException - return value for isFailOnException().
    • BaseEntityEventListener

      public BaseEntityEventListener(boolean failOnException, Class<?> entityClass)
  • Method Details

    • onEvent

      public final void onEvent(ActivitiEvent event)
      Description copied from interface: ActivitiEventListener
      Called when an event has been fired
      Specified by:
      onEvent in interface ActivitiEventListener
      Parameters:
      event - the event
    • isFailOnException

      public boolean isFailOnException()
      Specified by:
      isFailOnException in interface ActivitiEventListener
      Returns:
      whether or not the current operation should fail when this listeners execution throws an exception.
    • isValidEvent

      protected boolean isValidEvent(ActivitiEvent event)
      Returns:
      true, if the event is an ActivitiEntityEvent and (if needed) the entityClass set in this instance, is assignable from the entity class in the event.
    • onCreate

      protected void onCreate(ActivitiEvent event)
      Called when an entity create event is received.
    • onInitialized

      protected void onInitialized(ActivitiEvent event)
      Called when an entity initialized event is received.
    • onDelete

      protected void onDelete(ActivitiEvent event)
      Called when an entity delete event is received.
    • onUpdate

      protected void onUpdate(ActivitiEvent event)
      Called when an entity update event is received.
    • onEntityEvent

      protected void onEntityEvent(ActivitiEvent event)
      Called when an event is received, which is not a create, an update or delete.