use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class RetryIntervalsConfigurationTest method cleanBatch.
@After
public void cleanBatch() {
Batch batch = managementService.createBatchQuery().singleResult();
if (batch != null) {
managementService.deleteBatch(batch.getId(), true);
}
HistoricBatch historicBatch = engineRule.getHistoryService().createHistoricBatchQuery().singleResult();
if (historicBatch != null) {
engineRule.getHistoryService().deleteHistoricBatch(historicBatch.getId());
}
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class AbstractBatchAuthorizationTest method cleanBatch.
@After
public void cleanBatch() {
Batch batch = engineRule.getManagementService().createBatchQuery().singleResult();
if (batch != null) {
engineRule.getManagementService().deleteBatch(batch.getId(), true);
}
HistoricBatch historicBatch = engineRule.getHistoryService().createHistoricBatchQuery().singleResult();
if (historicBatch != null) {
engineRule.getHistoryService().deleteHistoricBatch(historicBatch.getId());
}
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class SetExternalTaskRetriesUserOperationLogTest method removeAllRunningAndHistoricBatches.
@After
public void removeAllRunningAndHistoricBatches() {
HistoryService historyService = rule.getHistoryService();
ManagementService managementService = rule.getManagementService();
for (Batch batch : managementService.createBatchQuery().list()) {
managementService.deleteBatch(batch.getId(), true);
}
// remove history of completed batches
for (HistoricBatch historicBatch : historyService.createHistoricBatchQuery().list()) {
historyService.deleteHistoricBatch(historicBatch.getId());
}
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class BatchModificationHistoryTest method testHistoricBatchForBatchDeletion.
@Test
public void testHistoricBatchForBatchDeletion() {
ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
Batch batch = helper.startTransitionAsync("process1", 1, "seq", processDefinition.getId());
// when
Date deletionDate = helper.addSecondsToClock(12);
rule.getManagementService().deleteBatch(batch.getId(), false);
// then the end time was set for the historic batch
HistoricBatch historicBatch = helper.getHistoricBatch(batch);
assertNotNull(historicBatch);
assertEquals(deletionDate, historicBatch.getEndTime());
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class BatchModificationHistoryTest method testHistoricBatchCreation.
@Test
public void testHistoricBatchCreation() {
// when
ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
Batch batch = helper.startAfterAsync("process1", 10, "user1", processDefinition.getId());
// then a historic batch was created
HistoricBatch historicBatch = helper.getHistoricBatch(batch);
assertNotNull(historicBatch);
assertEquals(batch.getId(), historicBatch.getId());
assertEquals(batch.getType(), historicBatch.getType());
assertEquals(batch.getTotalJobs(), historicBatch.getTotalJobs());
assertEquals(batch.getBatchJobsPerSeed(), historicBatch.getBatchJobsPerSeed());
assertEquals(batch.getInvocationsPerBatchJob(), historicBatch.getInvocationsPerBatchJob());
assertEquals(batch.getSeedJobDefinitionId(), historicBatch.getSeedJobDefinitionId());
assertEquals(batch.getMonitorJobDefinitionId(), historicBatch.getMonitorJobDefinitionId());
assertEquals(batch.getBatchJobDefinitionId(), historicBatch.getBatchJobDefinitionId());
assertEquals(START_DATE, historicBatch.getStartTime());
assertNull(historicBatch.getEndTime());
}
Aggregations