Search in sources :

Example 31 with HistoricExternalTaskLog

use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.

the class HistoricExternalTaskLogQueryTest method testQueryByNonExistingProcessDefinitionId.

@Test
public void testQueryByNonExistingProcessDefinitionId() {
    // given
    startExternalTaskProcess();
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().processDefinitionId("foo").singleResult();
    // then
    assertNull(log);
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) Test(org.junit.Test)

Example 32 with HistoricExternalTaskLog

use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.

the class HistoricExternalTaskLogQueryTest method testQueryByCreationLog.

@Test
public void testQueryByCreationLog() {
    // given
    ExternalTask task = startExternalTaskProcess();
    completeExternalTask(task.getId());
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().creationLog().singleResult();
    // then
    assertNotNull(log);
    assertThat(log.getExternalTaskId(), is(task.getId()));
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) ExternalTask(org.camunda.bpm.engine.externaltask.ExternalTask) LockedExternalTask(org.camunda.bpm.engine.externaltask.LockedExternalTask) Test(org.junit.Test)

Example 33 with HistoricExternalTaskLog

use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.

the class HistoricExternalTaskLogQueryTest method testQueryById.

@Test
public void testQueryById() {
    // given
    startExternalTaskProcesses(2);
    String logId = retrieveFirstHistoricExternalTaskLog().getId();
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().logId(logId).singleResult();
    // then
    assertNotNull(log);
    assertThat(log.getId(), is(logId));
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) Test(org.junit.Test)

Example 34 with HistoricExternalTaskLog

use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.

the class HistoricExternalTaskLogQueryTest method testQueryByProcessDefinitionKey.

@Test
public void testQueryByProcessDefinitionKey() {
    // given
    startExternalTaskProcessGivenProcessDefinitionKey("dummyProcess");
    ExternalTask task = startExternalTaskProcessGivenProcessDefinitionKey("Process");
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().processDefinitionKey(task.getProcessDefinitionKey()).singleResult();
    // then
    assertNotNull(log);
    assertThat(log.getExternalTaskId(), is(task.getId()));
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) ExternalTask(org.camunda.bpm.engine.externaltask.ExternalTask) LockedExternalTask(org.camunda.bpm.engine.externaltask.LockedExternalTask) Test(org.junit.Test)

Example 35 with HistoricExternalTaskLog

use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.

the class HistoricExternalTaskLogQueryTest method testQueryByHigherThanOrEqualAPriority.

@Test
public void testQueryByHigherThanOrEqualAPriority() {
    // given
    startExternalTaskProcesses(5);
    // when
    List<HistoricExternalTaskLog> externalTaskLogs = historyService.createHistoricExternalTaskLogQuery().priorityHigherThanOrEquals(2L).list();
    // then
    assertThat(externalTaskLogs.size(), is(3));
    for (HistoricExternalTaskLog log : externalTaskLogs) {
        assertTrue(log.getPriority() >= 2);
    }
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) Test(org.junit.Test)

Aggregations

HistoricExternalTaskLog (org.camunda.bpm.engine.history.HistoricExternalTaskLog)42 Test (org.junit.Test)37 ExternalTask (org.camunda.bpm.engine.externaltask.ExternalTask)19 LockedExternalTask (org.camunda.bpm.engine.externaltask.LockedExternalTask)12 HistoricExternalTaskLogQuery (org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)3 HistoryService (org.camunda.bpm.engine.HistoryService)2 ArrayList (java.util.ArrayList)1 HistoricExternalTaskLogDto (org.camunda.bpm.engine.rest.dto.history.HistoricExternalTaskLogDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1 Before (org.junit.Before)1