use of org.camunda.bpm.engine.impl.history.handler.HistoryEventHandler in project camunda-bpm-platform by camunda.
the class HistoryExecutionListener method notify.
public void notify(DelegateExecution execution) throws Exception {
// get the event handler
final HistoryEventHandler historyEventHandler = Context.getProcessEngineConfiguration().getHistoryEventHandler();
// delegate creation of the history event to the producer
HistoryEvent historyEvent = createHistoryEvent(execution);
if (historyEvent != null) {
// pass the event to the handler
historyEventHandler.handleEvent(historyEvent);
}
}
use of org.camunda.bpm.engine.impl.history.handler.HistoryEventHandler in project camunda-bpm-platform by camunda.
the class HistoryTaskListener method notify.
public void notify(DelegateTask task) {
// get the event handler
final HistoryEventHandler historyEventHandler = Context.getProcessEngineConfiguration().getHistoryEventHandler();
ExecutionEntity execution = ((TaskEntity) task).getExecution();
if (execution != null) {
// delegate creation of the history event to the producer
HistoryEvent historyEvent = createHistoryEvent(task, execution);
if (historyEvent != null) {
// pass the event to the handler
historyEventHandler.handleEvent(historyEvent);
}
}
}
use of org.camunda.bpm.engine.impl.history.handler.HistoryEventHandler in project camunda-bpm-platform by camunda.
the class CaseExecutionEntity method fireHistoricCaseActivityInstanceUpdate.
public void fireHistoricCaseActivityInstanceUpdate() {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getHistoryLevel();
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.CASE_ACTIVITY_INSTANCE_UPDATE, this)) {
CmmnHistoryEventProducer eventProducer = configuration.getCmmnHistoryEventProducer();
HistoryEventHandler eventHandler = configuration.getHistoryEventHandler();
HistoryEvent event = eventProducer.createCaseActivityInstanceUpdateEvt(this);
eventHandler.handleEvent(event);
}
}
use of org.camunda.bpm.engine.impl.history.handler.HistoryEventHandler in project camunda-bpm-platform by camunda.
the class CompositeHistoryEventHandlerTest method testCompositeHistoryEventHandlerArgumentConstructorWithNotEmptyListNotNullTwoEvents.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoryLevelTest.bpmn20.xml" })
public void testCompositeHistoryEventHandlerArgumentConstructorWithNotEmptyListNotNullTwoEvents() {
// prepare the list with two events
List<HistoryEventHandler> historyEventHandlers = new ArrayList<HistoryEventHandler>();
historyEventHandlers.add(new CustomDbHistoryEventHandler());
historyEventHandlers.add(new DbHistoryEventHandler());
CompositeHistoryEventHandler compositeHistoryEventHandler = new CompositeHistoryEventHandler(historyEventHandlers);
processEngineConfiguration.setHistoryEventHandler(compositeHistoryEventHandler);
startProcessAndCompleteUserTask();
assertEquals(2, countCustomHistoryEventHandler);
assertEquals(2, historyService.createHistoricDetailQuery().count());
}
use of org.camunda.bpm.engine.impl.history.handler.HistoryEventHandler in project camunda-bpm-platform by camunda.
the class CompositeHistoryEventHandlerTest method testCompositeHistoryEventHandlerArgumentConstructorWithEmptyList.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoryLevelTest.bpmn20.xml" })
public void testCompositeHistoryEventHandlerArgumentConstructorWithEmptyList() {
CompositeHistoryEventHandler compositeHistoryEventHandler = new CompositeHistoryEventHandler(new ArrayList<HistoryEventHandler>());
processEngineConfiguration.setHistoryEventHandler(compositeHistoryEventHandler);
startProcessAndCompleteUserTask();
assertEquals(0, countCustomHistoryEventHandler);
assertEquals(0, historyService.createHistoricDetailQuery().count());
}
Aggregations