Class DefaultHistoryEventProducer
- java.lang.Object
-
- org.camunda.bpm.engine.impl.history.producer.DefaultHistoryEventProducer
-
- All Implemented Interfaces:
HistoryEventProducer
- Direct Known Subclasses:
CacheAwareHistoryEventProducer
public class DefaultHistoryEventProducer extends java.lang.Object implements HistoryEventProducer
- Author:
- Daniel Meyer, Ingo Richtsmeier
-
-
Field Summary
Fields Modifier and Type Field Description protected static ConfigurationLogger
LOG
-
Constructor Summary
Constructors Constructor Description DefaultHistoryEventProducer()
-
Method Summary
-
-
-
Field Detail
-
LOG
protected static final ConfigurationLogger LOG
-
-
Method Detail
-
initActivityInstanceEvent
protected void initActivityInstanceEvent(HistoricActivityInstanceEventEntity evt, ExecutionEntity execution, HistoryEventType eventType)
-
initActivityInstanceEvent
protected void initActivityInstanceEvent(HistoricActivityInstanceEventEntity evt, MigratingActivityInstance migratingActivityInstance, HistoryEventType eventType)
-
initActivityInstanceEvent
protected void initActivityInstanceEvent(HistoricActivityInstanceEventEntity evt, ExecutionEntity execution, PvmScope eventSource, java.lang.String activityInstanceId, java.lang.String parentActivityInstanceId, HistoryEventType eventType)
-
initProcessInstanceEvent
protected void initProcessInstanceEvent(HistoricProcessInstanceEventEntity evt, ExecutionEntity execution, HistoryEventType eventType)
-
initTaskInstanceEvent
protected void initTaskInstanceEvent(HistoricTaskInstanceEventEntity evt, TaskEntity taskEntity, HistoryEventType eventType)
-
initHistoricVariableUpdateEvt
protected void initHistoricVariableUpdateEvt(HistoricVariableUpdateEventEntity evt, VariableInstanceEntity variableInstance, HistoryEventType eventType)
-
initUserOperationLogEvent
protected void initUserOperationLogEvent(UserOperationLogEntryEventEntity evt, UserOperationLogContext context, UserOperationLogContextEntry contextEntry, PropertyChange propertyChange)
-
initHistoricIncidentEvent
protected void initHistoricIncidentEvent(HistoricIncidentEventEntity evt, Incident incident, HistoryEventType eventType)
-
createHistoricVariableEvent
protected HistoryEvent createHistoricVariableEvent(VariableInstanceEntity variableInstance, VariableScope sourceVariableScope, HistoryEventType eventType)
-
newProcessInstanceEventEntity
protected HistoricProcessInstanceEventEntity newProcessInstanceEventEntity(ExecutionEntity execution)
-
newActivityInstanceEventEntity
protected HistoricActivityInstanceEventEntity newActivityInstanceEventEntity(ExecutionEntity execution)
-
newTaskInstanceEventEntity
protected HistoricTaskInstanceEventEntity newTaskInstanceEventEntity(DelegateTask task)
-
newVariableUpdateEventEntity
protected HistoricVariableUpdateEventEntity newVariableUpdateEventEntity(ExecutionEntity execution)
-
newHistoricFormPropertyEvent
protected HistoricFormPropertyEventEntity newHistoricFormPropertyEvent()
-
newIncidentEventEntity
protected HistoricIncidentEventEntity newIncidentEventEntity(Incident incident)
-
newHistoricJobLogEntity
protected HistoricJobLogEventEntity newHistoricJobLogEntity(Job job)
-
newBatchEventEntity
protected HistoricBatchEntity newBatchEventEntity(BatchEntity batch)
-
loadProcessInstanceEventEntity
protected HistoricProcessInstanceEventEntity loadProcessInstanceEventEntity(ExecutionEntity execution)
-
loadActivityInstanceEventEntity
protected HistoricActivityInstanceEventEntity loadActivityInstanceEventEntity(ExecutionEntity execution)
-
loadTaskInstanceEvent
protected HistoricTaskInstanceEventEntity loadTaskInstanceEvent(DelegateTask task)
-
loadIncidentEvent
protected HistoricIncidentEventEntity loadIncidentEvent(Incident incident)
-
loadBatchEntity
protected HistoricBatchEntity loadBatchEntity(BatchEntity batch)
-
createProcessInstanceStartEvt
public HistoryEvent createProcessInstanceStartEvt(DelegateExecution execution)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a process instances is created.- Specified by:
createProcessInstanceStartEvt
in interfaceHistoryEventProducer
- Parameters:
execution
- the current execution.- Returns:
- the history event
-
createProcessInstanceUpdateEvt
public HistoryEvent createProcessInstanceUpdateEvt(DelegateExecution execution)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a process instance is updated.- Specified by:
createProcessInstanceUpdateEvt
in interfaceHistoryEventProducer
- Parameters:
execution
- the process instance- Returns:
- the created history event
-
createProcessInstanceMigrateEvt
public HistoryEvent createProcessInstanceMigrateEvt(DelegateExecution execution)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a process instance is migrated.- Specified by:
createProcessInstanceMigrateEvt
in interfaceHistoryEventProducer
- Parameters:
execution
- the process instance- Returns:
- the created history event
-
createProcessInstanceEndEvt
public HistoryEvent createProcessInstanceEndEvt(DelegateExecution execution)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a process instance is ended.- Specified by:
createProcessInstanceEndEvt
in interfaceHistoryEventProducer
- Parameters:
execution
- the current execution.- Returns:
- the history event
-
addRemovalTimeToHistoricDecisions
protected void addRemovalTimeToHistoricDecisions(java.lang.String rootProcessInstanceId, java.util.Date removalTime)
-
addRemovalTimeToHistoricProcessInstances
protected void addRemovalTimeToHistoricProcessInstances(java.lang.String rootProcessInstanceId, java.util.Date removalTime)
-
isDmnEnabled
protected boolean isDmnEnabled()
-
determineEndState
protected void determineEndState(ExecutionEntity executionEntity, HistoricProcessInstanceEventEntity evt)
-
createActivityInstanceStartEvt
public HistoryEvent createActivityInstanceStartEvt(DelegateExecution execution)
Description copied from interface:HistoryEventProducer
Creates the history event fired when an activity instance is started.- Specified by:
createActivityInstanceStartEvt
in interfaceHistoryEventProducer
- Parameters:
execution
- the current execution.- Returns:
- the history event
-
createActivityInstanceUpdateEvt
public HistoryEvent createActivityInstanceUpdateEvt(DelegateExecution execution)
Description copied from interface:HistoryEventProducer
Creates the history event fired when an activity instance is updated.- Specified by:
createActivityInstanceUpdateEvt
in interfaceHistoryEventProducer
- Parameters:
execution
- the current execution.- Returns:
- the history event
-
createActivityInstanceUpdateEvt
public HistoryEvent createActivityInstanceUpdateEvt(DelegateExecution execution, DelegateTask task)
Description copied from interface:HistoryEventProducer
Creates the history event fired when an activity instance is updated.- Specified by:
createActivityInstanceUpdateEvt
in interfaceHistoryEventProducer
- Parameters:
execution
- the current execution.task
- the task association that is currently updated. (May be null in case there is not task associated.)- Returns:
- the history event
-
createActivityInstanceMigrateEvt
public HistoryEvent createActivityInstanceMigrateEvt(MigratingActivityInstance actInstance)
Description copied from interface:HistoryEventProducer
Creates the history event which is fired when an activity instance is migrated.- Specified by:
createActivityInstanceMigrateEvt
in interfaceHistoryEventProducer
- Parameters:
actInstance
- the migrated activity instance which contains the new id's- Returns:
- the created history event
-
createActivityInstanceEndEvt
public HistoryEvent createActivityInstanceEndEvt(DelegateExecution execution)
Description copied from interface:HistoryEventProducer
Creates the history event fired when an activity instance is ended.- Specified by:
createActivityInstanceEndEvt
in interfaceHistoryEventProducer
- Parameters:
execution
- the current execution.- Returns:
- the history event
-
createTaskInstanceCreateEvt
public HistoryEvent createTaskInstanceCreateEvt(DelegateTask task)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a task instance is created.- Specified by:
createTaskInstanceCreateEvt
in interfaceHistoryEventProducer
- Parameters:
task
- the task- Returns:
- the history event
-
createTaskInstanceUpdateEvt
public HistoryEvent createTaskInstanceUpdateEvt(DelegateTask task)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a task instance is updated.- Specified by:
createTaskInstanceUpdateEvt
in interfaceHistoryEventProducer
- Parameters:
task
- the task- Returns:
- the history event
-
createTaskInstanceMigrateEvt
public HistoryEvent createTaskInstanceMigrateEvt(DelegateTask task)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a task instance is migrated.- Specified by:
createTaskInstanceMigrateEvt
in interfaceHistoryEventProducer
- Parameters:
task
- the task- Returns:
- the history event
-
createTaskInstanceCompleteEvt
public HistoryEvent createTaskInstanceCompleteEvt(DelegateTask task, java.lang.String deleteReason)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a task instances is completed.- Specified by:
createTaskInstanceCompleteEvt
in interfaceHistoryEventProducer
- Parameters:
task
- the task- Returns:
- the history event
-
createUserOperationLogEvents
public java.util.List<HistoryEvent> createUserOperationLogEvents(UserOperationLogContext context)
Description copied from interface:HistoryEventProducer
Creates the history event fired whenever an operation has been performed by a user. This is used for logging actions such as creating a new Task, completing a task, canceling a a process instance, ...- Specified by:
createUserOperationLogEvents
in interfaceHistoryEventProducer
- Parameters:
context
- theUserOperationLogContext
providing the needed informations- Returns:
- a
List
ofHistoryEvent
s
-
createHistoricVariableCreateEvt
public HistoryEvent createHistoricVariableCreateEvt(VariableInstanceEntity variableInstance, VariableScope sourceVariableScope)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a variable is created.- Specified by:
createHistoricVariableCreateEvt
in interfaceHistoryEventProducer
- Parameters:
variableInstance
- the runtime variable instance- Returns:
- the history event
-
createHistoricVariableDeleteEvt
public HistoryEvent createHistoricVariableDeleteEvt(VariableInstanceEntity variableInstance, VariableScope sourceVariableScope)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a variable is deleted.- Specified by:
createHistoricVariableDeleteEvt
in interfaceHistoryEventProducer
- Returns:
- the history event
-
createHistoricVariableUpdateEvt
public HistoryEvent createHistoricVariableUpdateEvt(VariableInstanceEntity variableInstance, VariableScope sourceVariableScope)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a variable is updated.- Specified by:
createHistoricVariableUpdateEvt
in interfaceHistoryEventProducer
- Parameters:
variableInstance
- the runtime variable instance- Returns:
- the history event
-
createHistoricVariableMigrateEvt
public HistoryEvent createHistoricVariableMigrateEvt(VariableInstanceEntity variableInstance)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a variable is migrated.- Specified by:
createHistoricVariableMigrateEvt
in interfaceHistoryEventProducer
- Parameters:
variableInstance
- the runtime variable instance- Returns:
- the history event
-
createFormPropertyUpdateEvt
public HistoryEvent createFormPropertyUpdateEvt(ExecutionEntity execution, java.lang.String propertyId, java.lang.String propertyValue, java.lang.String taskId)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a form property is updated.- Specified by:
createFormPropertyUpdateEvt
in interfaceHistoryEventProducer
propertyId
- the id of the form propertypropertyValue
- the value of the form property- Returns:
- the history event
-
createHistoricIncidentCreateEvt
public HistoryEvent createHistoricIncidentCreateEvt(Incident incident)
- Specified by:
createHistoricIncidentCreateEvt
in interfaceHistoryEventProducer
-
createHistoricIncidentUpdateEvt
public HistoryEvent createHistoricIncidentUpdateEvt(Incident incident)
- Specified by:
createHistoricIncidentUpdateEvt
in interfaceHistoryEventProducer
-
createHistoricIncidentResolveEvt
public HistoryEvent createHistoricIncidentResolveEvt(Incident incident)
- Specified by:
createHistoricIncidentResolveEvt
in interfaceHistoryEventProducer
-
createHistoricIncidentDeleteEvt
public HistoryEvent createHistoricIncidentDeleteEvt(Incident incident)
- Specified by:
createHistoricIncidentDeleteEvt
in interfaceHistoryEventProducer
-
createHistoricIncidentMigrateEvt
public HistoryEvent createHistoricIncidentMigrateEvt(Incident incident)
- Specified by:
createHistoricIncidentMigrateEvt
in interfaceHistoryEventProducer
-
createHistoricIncidentEvt
protected HistoryEvent createHistoricIncidentEvt(Incident incident, HistoryEventTypes eventType)
-
createHistoricIdentityLinkAddEvent
public HistoryEvent createHistoricIdentityLinkAddEvent(IdentityLink identityLink)
Description copied from interface:HistoryEventProducer
Fired when an identity link is added- Specified by:
createHistoricIdentityLinkAddEvent
in interfaceHistoryEventProducer
- Returns:
-
createHistoricIdentityLinkDeleteEvent
public HistoryEvent createHistoricIdentityLinkDeleteEvent(IdentityLink identityLink)
Description copied from interface:HistoryEventProducer
Fired when an identity links is deleted- Specified by:
createHistoricIdentityLinkDeleteEvent
in interfaceHistoryEventProducer
- Returns:
-
createHistoricIdentityLinkEvt
protected HistoryEvent createHistoricIdentityLinkEvt(IdentityLink identityLink, HistoryEventTypes eventType)
-
newIdentityLinkEventEntity
protected HistoricIdentityLinkLogEventEntity newIdentityLinkEventEntity()
-
initHistoricIdentityLinkEvent
protected void initHistoricIdentityLinkEvent(HistoricIdentityLinkLogEventEntity evt, IdentityLink identityLink, HistoryEventType eventType)
-
createBatchStartEvent
public HistoryEvent createBatchStartEvent(Batch batch)
Description copied from interface:HistoryEventProducer
Creates the history event fired when the a batch has been started.- Specified by:
createBatchStartEvent
in interfaceHistoryEventProducer
-
createBatchEndEvent
public HistoryEvent createBatchEndEvent(Batch batch)
Description copied from interface:HistoryEventProducer
Creates the history event fired when the a batch has been completed.- Specified by:
createBatchEndEvent
in interfaceHistoryEventProducer
-
createBatchUpdateEvent
public HistoryEvent createBatchUpdateEvent(Batch batch)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a batch has been updated.- Specified by:
createBatchUpdateEvent
in interfaceHistoryEventProducer
-
createBatchEvent
protected HistoryEvent createBatchEvent(BatchEntity batch, HistoryEventTypes eventType)
-
createHistoricJobLogCreateEvt
public HistoryEvent createHistoricJobLogCreateEvt(Job job)
Description copied from interface:HistoryEventProducer
Creates the history event fired when a job has been created.- Specified by:
createHistoricJobLogCreateEvt
in interfaceHistoryEventProducer
-
createHistoricJobLogFailedEvt
public HistoryEvent createHistoricJobLogFailedEvt(Job job, java.lang.Throwable exception)
Description copied from interface:HistoryEventProducer
Creates the history event fired when the execution of a job failed.- Specified by:
createHistoricJobLogFailedEvt
in interfaceHistoryEventProducer
-
createHistoricJobLogSuccessfulEvt
public HistoryEvent createHistoricJobLogSuccessfulEvt(Job job)
Description copied from interface:HistoryEventProducer
Creates the history event fired when the execution of a job was successful.- Specified by:
createHistoricJobLogSuccessfulEvt
in interfaceHistoryEventProducer
-
createHistoricJobLogDeleteEvt
public HistoryEvent createHistoricJobLogDeleteEvt(Job job)
Description copied from interface:HistoryEventProducer
Creates the history event fired when the a job has been deleted.- Specified by:
createHistoricJobLogDeleteEvt
in interfaceHistoryEventProducer
-
createHistoricJobLogEvt
protected HistoryEvent createHistoricJobLogEvt(Job job, HistoryEventType eventType)
-
initHistoricJobLogEvent
protected void initHistoricJobLogEvent(HistoricJobLogEventEntity evt, Job job, HistoryEventType eventType)
-
createHistoricExternalTaskLogCreatedEvt
public HistoryEvent createHistoricExternalTaskLogCreatedEvt(ExternalTask task)
Description copied from interface:HistoryEventProducer
Creates the history event when an external task has been created.- Specified by:
createHistoricExternalTaskLogCreatedEvt
in interfaceHistoryEventProducer
-
createHistoricExternalTaskLogFailedEvt
public HistoryEvent createHistoricExternalTaskLogFailedEvt(ExternalTask task)
Description copied from interface:HistoryEventProducer
Creates the history event when the execution of an external task has failed.- Specified by:
createHistoricExternalTaskLogFailedEvt
in interfaceHistoryEventProducer
-
createHistoricExternalTaskLogSuccessfulEvt
public HistoryEvent createHistoricExternalTaskLogSuccessfulEvt(ExternalTask task)
Description copied from interface:HistoryEventProducer
Creates the history event when the execution of an external task was successful.- Specified by:
createHistoricExternalTaskLogSuccessfulEvt
in interfaceHistoryEventProducer
-
createHistoricExternalTaskLogDeletedEvt
public HistoryEvent createHistoricExternalTaskLogDeletedEvt(ExternalTask task)
Description copied from interface:HistoryEventProducer
Creates the history event when an external task has been deleted.- Specified by:
createHistoricExternalTaskLogDeletedEvt
in interfaceHistoryEventProducer
-
initHistoricExternalTaskLog
protected HistoricExternalTaskLogEntity initHistoricExternalTaskLog(ExternalTaskEntity entity, ExternalTaskState state)
-
isRootProcessInstance
protected boolean isRootProcessInstance(HistoricProcessInstanceEventEntity evt)
-
isHistoryRemovalTimeStrategyStart
protected boolean isHistoryRemovalTimeStrategyStart()
-
isHistoryRemovalTimeStrategyEnd
protected boolean isHistoryRemovalTimeStrategyEnd()
-
getHistoryRemovalTimeStrategy
protected java.lang.String getHistoryRemovalTimeStrategy()
-
calculateRemovalTime
protected java.util.Date calculateRemovalTime(HistoryEvent historyEvent)
-
calculateRemovalTime
protected java.util.Date calculateRemovalTime(HistoricBatchEntity historicBatch)
-
provideRemovalTime
protected void provideRemovalTime(HistoricBatchEntity historicBatch)
-
provideRemovalTime
protected void provideRemovalTime(HistoryEvent historyEvent)
-
getHistoricRootProcessInstance
protected HistoricProcessInstanceEventEntity getHistoricRootProcessInstance(java.lang.String rootProcessInstanceId)
-
findProcessDefinitionById
protected ProcessDefinition findProcessDefinitionById(java.lang.String processDefinitionId)
-
getHistoricBatchById
protected HistoricBatchEntity getHistoricBatchById(java.lang.String batchId)
-
getHistoricBatchByJobId
protected HistoricBatchEntity getHistoricBatchByJobId(java.lang.String jobId)
-
addRemovalTimeToHistoricJobLog
protected void addRemovalTimeToHistoricJobLog(HistoricBatchEntity historicBatch)
-
addRemovalTimeToHistoricIncidents
protected void addRemovalTimeToHistoricIncidents(HistoricBatchEntity historicBatch)
-
initSequenceCounter
protected void initSequenceCounter(ExecutionEntity execution, HistoryEvent event)
-
initSequenceCounter
protected void initSequenceCounter(VariableInstanceEntity variable, HistoryEvent event)
-
initSequenceCounter
protected void initSequenceCounter(JobEntity job, HistoryEvent event)
-
initSequenceCounter
protected void initSequenceCounter(long sequenceCounter, HistoryEvent event)
-
-