use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class ProcessEngineRestServiceTest method createHistoricJobLogMock.
private void createHistoricJobLogMock() {
HistoricJobLogQuery mockHistoricJobLogQuery = mock(HistoricJobLogQuery.class);
List<HistoricJobLog> historicJobLogs = MockProvider.createMockHistoricJobLogs();
when(mockHistoricJobLogQuery.list()).thenReturn(historicJobLogs);
when(mockHistoryService.createHistoricJobLogQuery()).thenReturn(mockHistoricJobLogQuery);
}
use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class HistoricJobLogResourceImpl method getHistoricJobLog.
public HistoricJobLogDto getHistoricJobLog() {
HistoryService historyService = engine.getHistoryService();
HistoricJobLog historicJobLog = historyService.createHistoricJobLogQuery().logId(id).singleResult();
if (historicJobLog == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Historic job log with id " + id + " does not exist");
}
return HistoricJobLogDto.fromHistoricJobLog(historicJobLog);
}
use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class HistoryCleanupHistoricBatchTest method findExceptionByteArrayIds.
private List<String> findExceptionByteArrayIds() {
List<String> exceptionByteArrayIds = new ArrayList<String>();
List<HistoricJobLog> historicJobLogs = historyService.createHistoricJobLogQuery().list();
for (HistoricJobLog historicJobLog : historicJobLogs) {
HistoricJobLogEventEntity historicJobLogEventEntity = (HistoricJobLogEventEntity) historicJobLog;
if (historicJobLogEventEntity.getExceptionByteArrayId() != null) {
exceptionByteArrayIds.add(historicJobLogEventEntity.getExceptionByteArrayId());
}
}
return exceptionByteArrayIds;
}
use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class BatchModificationHistoryTest method testHistoricMonitorJobLogForBatchDeletion.
@Test
public void testHistoricMonitorJobLogForBatchDeletion() {
ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
Batch batch = helper.startAfterAsync("process1", 1, "user1", processDefinition.getId());
helper.executeSeedJob(batch);
// when
Date deletionDate = helper.addSecondsToClock(12);
rule.getManagementService().deleteBatch(batch.getId(), false);
// then a deletion historic job log was added
HistoricJobLog jobLog = helper.getHistoricMonitorJobLog(batch).get(1);
assertNotNull(jobLog);
assertTrue(jobLog.isDeletionLog());
assertEquals(deletionDate, jobLog.getTimestamp());
}
use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class BatchModificationHistoryTest method testHistoricSeedJobLogForBatchDeletion.
@Test
public void testHistoricSeedJobLogForBatchDeletion() {
ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
Batch batch = helper.startBeforeAsync("process1", 1, "user1", processDefinition.getId());
// when
Date deletionDate = helper.addSecondsToClock(12);
rule.getManagementService().deleteBatch(batch.getId(), false);
// then a deletion historic job log was added
HistoricJobLog jobLog = helper.getHistoricSeedJobLog(batch).get(1);
assertNotNull(jobLog);
assertTrue(jobLog.isDeletionLog());
assertEquals(deletionDate, jobLog.getTimestamp());
}
Aggregations