use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogTest method testHistoricExternalTaskLogSuccessfulProperties.
@Test
public void testHistoricExternalTaskLogSuccessfulProperties() {
// given
ExternalTask task = startExternalTaskProcess();
completeExternalTask(task.getId());
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().successLog().singleResult();
// then
assertHistoricLogPropertiesAreProperlySet(task, log);
assertEquals(WORKER_ID, log.getWorkerId());
assertLogIsInSuccessfulState(log);
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogRestServiceInteractionTest method setUpRuntimeData.
@Before
public void setUpRuntimeData() {
mockQuery = mock(HistoricExternalTaskLogQuery.class);
HistoricExternalTaskLog mockedHistoricExternalTaskLog = MockProvider.createMockHistoricExternalTaskLog();
when(mockQuery.singleResult()).thenReturn(mockedHistoricExternalTaskLog);
when(mockQuery.logId(MockProvider.EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_ID)).thenReturn(mockQuery);
mockHistoryService = mock(HistoryService.class);
when(mockHistoryService.createHistoricExternalTaskLogQuery()).thenReturn(mockQuery);
namedProcessEngine = getProcessEngine(MockProvider.EXAMPLE_PROCESS_ENGINE_NAME);
when(namedProcessEngine.getHistoryService()).thenReturn(mockHistoryService);
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogRestServiceImpl method queryHistoricExternalTaskLogs.
@Override
public List<HistoricExternalTaskLogDto> queryHistoricExternalTaskLogs(HistoricExternalTaskLogQueryDto queryDto, Integer firstResult, Integer maxResults) {
queryDto.setObjectMapper(objectMapper);
HistoricExternalTaskLogQuery query = queryDto.toQuery(processEngine);
List<HistoricExternalTaskLog> matchingHistoricExternalTaskLogs;
if (firstResult != null || maxResults != null) {
matchingHistoricExternalTaskLogs = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingHistoricExternalTaskLogs = query.list();
}
List<HistoricExternalTaskLogDto> results = new ArrayList<HistoricExternalTaskLogDto>();
for (HistoricExternalTaskLog historicExternalTaskLog : matchingHistoricExternalTaskLogs) {
HistoricExternalTaskLogDto result = HistoricExternalTaskLogDto.fromHistoricExternalTaskLog(historicExternalTaskLog);
results.add(result);
}
return results;
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogTest method testHistoricExternalTaskLogFailedProperties.
@Test
public void testHistoricExternalTaskLogFailedProperties() {
// given
ExternalTask task = startExternalTaskProcess();
reportExternalTaskFailure(task.getId());
task = externalTaskService.createExternalTaskQuery().singleResult();
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().failureLog().singleResult();
// then
assertHistoricLogPropertiesAreProperlySet(task, log);
assertEquals(WORKER_ID, log.getWorkerId());
assertLogIsInFailedState(log);
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogTest method testHistoricExternalTaskLogCreateProperties.
@Test
public void testHistoricExternalTaskLogCreateProperties() {
// given
ExternalTask task = startExternalTaskProcess();
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().creationLog().singleResult();
// then
assertHistoricLogPropertiesAreProperlySet(task, log);
assertEquals(null, log.getWorkerId());
assertLogIsInCreatedState(log);
}
Aggregations