use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class BatchMigrationHistoryTest method testDeleteHistoricBatch.
@Test
public void testDeleteHistoricBatch() {
Batch batch = helper.migrateProcessInstancesAsync(1);
helper.executeSeedJob(batch);
helper.executeJobs(batch);
helper.executeMonitorJob(batch);
// when
HistoricBatch historicBatch = helper.getHistoricBatch(batch);
historyService.deleteHistoricBatch(historicBatch.getId());
// then the historic batch was removed and all job logs
assertNull(helper.getHistoricBatch(batch));
assertTrue(helper.getHistoricSeedJobLog(batch).isEmpty());
assertTrue(helper.getHistoricMonitorJobLog(batch).isEmpty());
assertTrue(helper.getHistoricBatchJobLog(batch).isEmpty());
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class BatchMigrationHistoryTest method testHistoricBatchForBatchDeletion.
@Test
public void testHistoricBatchForBatchDeletion() {
Batch batch = helper.migrateProcessInstancesAsync(1);
// when
Date deletionDate = helper.addSecondsToClock(12);
managementService.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 HistoricBatchQueryAuthorizationTest method removeAllRunningAndHistoricBatches.
private void removeAllRunningAndHistoricBatches() {
HistoryService historyService = engineRule.getHistoryService();
ManagementService managementService = engineRule.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 SetExternalTasksRetriesBatchAuthorizationTest 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 MultiTenancyHistoricBatchQueryTest method testHistoricBatchQueryFilterWithoutTenantId.
@Test
public void testHistoricBatchQueryFilterWithoutTenantId() {
// when
HistoricBatch returnedBatch = historyService.createHistoricBatchQuery().withoutTenantId().singleResult();
// then
Assert.assertNotNull(returnedBatch);
Assert.assertEquals(sharedBatch.getId(), returnedBatch.getId());
}
Aggregations