Class BaseEntityEventListener
- java.lang.Object
-
- org.flowable.common.engine.api.delegate.event.AbstractFlowableEventListener
-
- org.flowable.engine.delegate.event.BaseEntityEventListener
-
- All Implemented Interfaces:
FlowableEventListener
- Direct Known Subclasses:
DebugInfoEntityEventListener
public class BaseEntityEventListener extends AbstractFlowableEventListener
Base event listener that can be used when implementing anFlowableEventListenerto get notified when an entity is created, updated, deleted or if another entity-related event occurs. Override theonXX(..)methods to respond to entity changes accordingly.- Author:
- Frederik Heremans
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<?>entityClassprotected booleanfailOnException-
Fields inherited from class org.flowable.common.engine.api.delegate.event.AbstractFlowableEventListener
onTransaction
-
-
Constructor Summary
Constructors Constructor Description BaseEntityEventListener()Create a new BaseEntityEventListener, notified when an event that targets any type of entity is received.BaseEntityEventListener(boolean failOnException)Create a new BaseEntityEventListener.BaseEntityEventListener(boolean failOnException, Class<?> entityClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisFailOnException()protected booleanisValidEvent(FlowableEvent event)protected voidonCreate(FlowableEvent event)Called when an entity create event is received.protected voidonDelete(FlowableEvent event)Called when an entity delete event is received.protected voidonEntityEvent(FlowableEvent event)Called when an event is received, which is not a create, an update or delete.voidonEvent(FlowableEvent event)protected voidonInitialized(FlowableEvent event)Called when an entity initialized event is received.protected voidonUpdate(FlowableEvent event)Called when an entity update event is received.-
Methods inherited from class org.flowable.common.engine.api.delegate.event.AbstractFlowableEventListener
getOnTransaction, isFireOnTransactionLifecycleEvent, setOnTransaction
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.flowable.common.engine.api.delegate.event.FlowableEventListener
getTypes
-
-
-
-
Field Detail
-
failOnException
protected boolean failOnException
-
entityClass
protected Class<?> entityClass
-
-
Constructor Detail
-
BaseEntityEventListener
public BaseEntityEventListener()
Create a new BaseEntityEventListener, notified when an event that targets any type of entity is received. Returning true whenisFailOnException()is called.
-
BaseEntityEventListener
public BaseEntityEventListener(boolean failOnException)
Create a new BaseEntityEventListener.- Parameters:
failOnException- return value forisFailOnException().
-
BaseEntityEventListener
public BaseEntityEventListener(boolean failOnException, Class<?> entityClass)
-
-
Method Detail
-
onEvent
public final void onEvent(FlowableEvent event)
-
isFailOnException
public boolean isFailOnException()
-
isValidEvent
protected boolean isValidEvent(FlowableEvent event)
- Returns:
- true, if the event is an
FlowableEntityEventand (if needed) the entityClass set in this instance, is assignable from the entity class in the event.
-
onCreate
protected void onCreate(FlowableEvent event)
Called when an entity create event is received.
-
onInitialized
protected void onInitialized(FlowableEvent event)
Called when an entity initialized event is received.
-
onDelete
protected void onDelete(FlowableEvent event)
Called when an entity delete event is received.
-
onUpdate
protected void onUpdate(FlowableEvent event)
Called when an entity update event is received.
-
onEntityEvent
protected void onEntityEvent(FlowableEvent event)
Called when an event is received, which is not a create, an update or delete.
-
-