protected boolean isHistoryEventProduced(HistoryEventType eventType, Job job) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); HistoryLevel historyLevel = configuration.getHistoryLevel(); return historyLevel.isHistoryEventProduced(eventType, job); }
protected boolean isHistoryEventProduced(HistoryEventType eventType, Job job) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); HistoryLevel historyLevel = configuration.getHistoryLevel(); return historyLevel.isHistoryEventProduced(eventType, job); }
protected void migrateProcessInstanceHistory(final DelegateExecution execution) { HistoryLevel historyLevel = Context.getProcessEngineConfiguration().getHistoryLevel(); if (!historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_MIGRATE, this)) { return; } HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createProcessInstanceUpdateEvt(execution); } }); }
protected void migrateActivityInstanceHistory(final DelegateExecution execution) { HistoryLevel historyLevel = Context.getProcessEngineConfiguration().getHistoryLevel(); if (!historyLevel.isHistoryEventProduced(HistoryEventTypes.ACTIVITY_INSTANCE_MIGRATE, this)) { return; } HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createActivityInstanceMigrateEvt(MigratingActivityInstance.this); } }); }
protected boolean isHistoryEventProduced() { HistoryLevel historyLevel = Context.getProcessEngineConfiguration().getHistoryLevel(); return historyLevel.isHistoryEventProduced(HistoryEventTypes.IDENTITY_LINK_ADD, null) || historyLevel.isHistoryEventProduced(HistoryEventTypes.IDENTITY_LINK_DELETE, null); }
protected void migrateHistory() { HistoryLevel historyLevel = Context.getProcessEngineConfiguration().getHistoryLevel(); if (historyLevel.isHistoryEventProduced(HistoryEventTypes.INCIDENT_MIGRATE, this)) { HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createHistoricIncidentMigrateEvt(incident); } }); } }
protected void migrateHistory() { HistoryLevel historyLevel = Context.getProcessEngineConfiguration().getHistoryLevel(); if (historyLevel.isHistoryEventProduced(HistoryEventTypes.VARIABLE_INSTANCE_MIGRATE, this)) { HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createHistoricVariableMigrateEvt(variable); } }); } }
public void createHistoricBatch(final BatchEntity batch) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); HistoryLevel historyLevel = configuration.getHistoryLevel(); if(historyLevel.isHistoryEventProduced(HistoryEventTypes.BATCH_START, batch)) { HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createBatchStartEvent(batch); } }); } }
public void completeHistoricBatch(final BatchEntity batch) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); HistoryLevel historyLevel = configuration.getHistoryLevel(); if(historyLevel.isHistoryEventProduced(HistoryEventTypes.BATCH_END, batch)) { HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createBatchEndEvent(batch); } }); } }
public void updateHistoricTaskInstance(final TaskEntity taskEntity) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); HistoryLevel historyLevel = configuration.getHistoryLevel(); if(historyLevel.isHistoryEventProduced(HistoryEventTypes.TASK_INSTANCE_UPDATE, taskEntity)) { HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createTaskInstanceUpdateEvt(taskEntity); } }); } }
protected void migrateHistory() { HistoryLevel historyLevel = Context.getProcessEngineConfiguration().getHistoryLevel(); if (historyLevel.isHistoryEventProduced(HistoryEventTypes.INCIDENT_MIGRATE, this)) { HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createHistoricIncidentMigrateEvt(incident); } }); } }
protected boolean shouldWriteHistoricDetail(HistoricVariableUpdateEventEntity historyEvent) { return Context.getProcessEngineConfiguration().getHistoryLevel() .isHistoryEventProduced(HistoryEventTypes.VARIABLE_INSTANCE_UPDATE_DETAIL, historyEvent) && !historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_MIGRATE); }
public void createHistoricBatch(final BatchEntity batch) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); HistoryLevel historyLevel = configuration.getHistoryLevel(); if(historyLevel.isHistoryEventProduced(HistoryEventTypes.BATCH_START, batch)) { HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createBatchStartEvent(batch); } }); } }
public static void clearUserOperationLog(ProcessEngineConfigurationImpl processEngineConfiguration) { if (processEngineConfiguration.getHistoryLevel().equals(HistoryLevel.HISTORY_LEVEL_FULL)) { HistoryService historyService = processEngineConfiguration.getHistoryService(); List<UserOperationLogEntry> logs = historyService.createUserOperationLogQuery().list(); for (UserOperationLogEntry log : logs) { historyService.deleteUserOperationLogEntry(log.getId()); } } }
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); } }
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); } }
@Test public void testGetTaskAttachmentsWithTaskIdNull() { int historyLevel = processEngineConfiguration.getHistoryLevel().getId(); if (historyLevel> ProcessEngineConfigurationImpl.HISTORYLEVEL_NONE) { assertEquals(Collections.<Attachment>emptyList(), taskService.getTaskAttachments(null)); } }
@Test public void testGetTaskAttachmentWithNullParameters() { int historyLevel = processEngineConfiguration.getHistoryLevel().getId(); if (historyLevel> ProcessEngineConfigurationImpl.HISTORYLEVEL_NONE) { Attachment attachment = taskService.getTaskAttachment(null, null); assertNull(attachment); } }
@Deployment(resources = {"org/camunda/bpm/engine/test/bpmn/multiinstance/MultiInstanceTest.testParallelScriptTasksCompletionCondition.bpmn20.xml"}) public void testParallelScriptTasksCompletionConditionHistory() { runtimeService.startProcessInstanceByKey("miParallelScriptTaskCompletionCondition"); if (processEngineConfiguration.getHistoryLevel().getId() > ProcessEngineConfigurationImpl.HISTORYLEVEL_NONE) { List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery().activityType("scriptTask").list(); assertEquals(2, historicActivityInstances.size()); } }
@Test public void secondEngineCopiesHistoryLevelFromFirst() { // given buildEngine(config("true", ProcessEngineConfiguration.HISTORY_FULL)); // when ProcessEngineImpl processEngineTwo = buildEngine(config("true", ProcessEngineConfiguration.HISTORY_AUTO)); // then assertThat(processEngineTwo.getProcessEngineConfiguration().getHistory(), is(ProcessEngineConfiguration.HISTORY_AUTO)); assertThat(processEngineTwo.getProcessEngineConfiguration().getHistoryLevel(), is(HistoryLevel.HISTORY_LEVEL_FULL)); }