use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQueryTest method testQueryByWorkerId.
@Test
public void testQueryByWorkerId() {
// given
List<ExternalTask> taskList = startExternalTaskProcesses(2);
ExternalTask taskToCheck = taskList.get(1);
completeExternalTaskWithWorker(taskList.get(0).getId(), "dummyWorker");
completeExternalTaskWithWorker(taskToCheck.getId(), WORKER_ID);
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().workerId(WORKER_ID).singleResult();
// then
assertNotNull(log);
assertThat(log.getExternalTaskId(), is(taskToCheck.getId()));
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQueryTest method testQueryByErrorMessage.
@Test
public void testQueryByErrorMessage() {
// given
List<ExternalTask> taskList = startExternalTaskProcesses(2);
String errorMessage = "This is an important error!";
reportExternalTaskFailure(taskList.get(0).getId(), "Dummy error message");
reportExternalTaskFailure(taskList.get(1).getId(), errorMessage);
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().errorMessage(errorMessage).singleResult();
// then
assertNotNull(log);
assertThat(log.getExternalTaskId(), is(taskList.get(1).getId()));
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQueryTest method testQueryByProcessDefinitionId.
@Test
public void testQueryByProcessDefinitionId() {
// given
startExternalTaskProcesses(2);
String definitionId = retrieveFirstHistoricExternalTaskLog().getProcessDefinitionId();
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().processDefinitionId(definitionId).singleResult();
// then
assertNotNull(log);
assertThat(log.getProcessDefinitionId(), is(definitionId));
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQueryTest method testQueryByExecutionIds.
@Test
public void testQueryByExecutionIds() {
// given
startExternalTaskProcesses(2);
HistoricExternalTaskLog taskLog = retrieveFirstHistoricExternalTaskLog();
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().executionIdIn(taskLog.getExecutionId()).singleResult();
// then
assertNotNull(log);
assertThat(log.getId(), is(taskLog.getId()));
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQueryTest method testQueryByNonExistingExternalTaskId.
@Test
public void testQueryByNonExistingExternalTaskId() {
// given
startExternalTaskProcess();
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().externalTaskId("foo").singleResult();
// then
assertNull(log);
}
Aggregations