Search in sources :

Example 6 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogQueryTest method testQueryByNonExistingActivityIds.

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

Example 7 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogQueryTest method testQueryByActivityInstanceIds.

@Test
public void testQueryByActivityInstanceIds() {
    // given
    startExternalTaskProcessGivenActivityId("dummyName");
    ExternalTask task = startExternalTaskProcess();
    String activityInstanceId = historyService.createHistoricActivityInstanceQuery().activityId(DEFAULT_EXTERNAL_TASK_NAME).singleResult().getId();
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().activityInstanceIdIn(activityInstanceId).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 8 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogQueryTest method testQueryByFailureLog.

@Test
public void testQueryByFailureLog() {
    // given
    ExternalTask task = startExternalTaskProcess();
    reportExternalTaskFailure(task.getId(), "Dummy error message!");
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().failureLog().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 9 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogQueryTest method testQueryByTopicName.

@Test
public void testQueryByTopicName() {
    // given
    String dummyTopic = "dummy";
    startExternalTaskProcessGivenTopicName(dummyTopic);
    ExternalTask task = startExternalTaskProcess();
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().topicName(DEFAULT_TOPIC).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 10 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogQueryTest method testQueryByNonExistingProcessInstanceId.

@Test
public void testQueryByNonExistingProcessInstanceId() {
    // given
    startExternalTaskProcess();
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().processInstanceId("foo").singleResult();
    // then
    assertNull(log);
}
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