use of org.camunda.bpm.engine.impl.history.HistoryLevel in project camunda-bpm-platform by camunda.
the class DetermineHistoryLevelCmdTest method useDefaultLevelAudit.
@Test
public void useDefaultLevelAudit() throws Exception {
ProcessEngineConfigurationImpl config = config("true", ProcessEngineConfiguration.HISTORY_AUTO);
// init the db with level=auto -> audit
processEngineImpl = (ProcessEngineImpl) config.buildProcessEngine();
// the history Level has been overwritten with audit
assertThat(config.getHistoryLevel(), CoreMatchers.equalTo(HistoryLevel.HISTORY_LEVEL_AUDIT));
// and this is written to the database
HistoryLevel databaseLevel = config.getCommandExecutorSchemaOperations().execute(new DetermineHistoryLevelCmd(config.getHistoryLevels()));
assertThat(databaseLevel, CoreMatchers.equalTo(HistoryLevel.HISTORY_LEVEL_AUDIT));
}
use of org.camunda.bpm.engine.impl.history.HistoryLevel 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.HistoryLevel in project camunda-bpm-platform by camunda.
the class ConcurrentHistoryLevelTest method test.
public void test() throws InterruptedException {
ThreadControl thread1 = executeControllableCommand(new ControllableUpdateHistoryLevelCommand());
thread1.waitForSync();
ThreadControl thread2 = executeControllableCommand(new ControllableUpdateHistoryLevelCommand());
thread2.waitForSync();
thread1.makeContinue();
thread1.waitForSync();
thread2.makeContinue();
Thread.sleep(2000);
thread1.waitUntilDone();
thread2.waitForSync();
thread2.waitUntilDone();
assertNull(thread1.exception);
assertNull(thread2.exception);
HistoryLevel historyLevel = processEngineConfiguration.getHistoryLevel();
assertEquals("full", historyLevel.getName());
}
use of org.camunda.bpm.engine.impl.history.HistoryLevel in project camunda-bpm-platform by camunda.
the class ExecutionEntity method fireHistoricProcessStartEvent.
@Override
public void fireHistoricProcessStartEvent() {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getHistoryLevel();
// ParseListener
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_START, processInstance)) {
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createProcessInstanceStartEvt(processInstance);
}
});
}
}
use of org.camunda.bpm.engine.impl.history.HistoryLevel 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);
}
});
}
}
Aggregations