use of org.camunda.bpm.engine.impl.history.event.HistoryEvent in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceManager method createHistoricTask.
public void createHistoricTask(final TaskEntity task) {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getHistoryLevel();
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.TASK_INSTANCE_CREATE, task)) {
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createTaskInstanceCreateEvt(task);
}
});
}
}
use of org.camunda.bpm.engine.impl.history.event.HistoryEvent in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceManager method markTaskInstanceEnded.
public void markTaskInstanceEnded(String taskId, final String deleteReason) {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
final TaskEntity taskEntity = Context.getCommandContext().getDbEntityManager().selectById(TaskEntity.class, taskId);
HistoryLevel historyLevel = configuration.getHistoryLevel();
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.TASK_INSTANCE_COMPLETE, taskEntity)) {
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createTaskInstanceCompleteEvt(taskEntity, deleteReason);
}
});
}
}
use of org.camunda.bpm.engine.impl.history.event.HistoryEvent in project camunda-bpm-platform by camunda.
the class IdentityLinkEntity method fireHistoricIdentityLinkEvent.
public void fireHistoricIdentityLinkEvent(final HistoryEventType eventType) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = processEngineConfiguration.getHistoryLevel();
if (historyLevel.isHistoryEventProduced(eventType, this)) {
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
HistoryEvent event = null;
if (HistoryEvent.IDENTITY_LINK_ADD.equals(eventType.getEventName())) {
event = producer.createHistoricIdentityLinkAddEvent(IdentityLinkEntity.this);
} else if (HistoryEvent.IDENTITY_LINK_DELETE.equals(eventType.getEventName())) {
event = producer.createHistoricIdentityLinkDeleteEvent(IdentityLinkEntity.this);
}
return event;
}
});
}
}
Aggregations