Search in sources :

Example 61 with HistoricJobLogQuery

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

the class HistoricJobLogQueryTest method testQuerySortingPartiallyByOccurrence.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml" })
public void testQuerySortingPartiallyByOccurrence() {
    String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
    String jobId = managementService.createJobQuery().singleResult().getId();
    executeAvailableJobs();
    runtimeService.setVariable(processInstanceId, "fail", false);
    managementService.executeJob(jobId);
    // asc
    HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().jobId(jobId).orderPartiallyByOccurrence().asc();
    verifyQueryWithOrdering(query, 5, historicJobLogPartiallyByOccurence());
    // desc
    query = historyService.createHistoricJobLogQuery().jobId(jobId).orderPartiallyByOccurrence().desc();
    verifyQueryWithOrdering(query, 5, inverted(historicJobLogPartiallyByOccurence()));
    runtimeService.deleteProcessInstance(processInstanceId, null);
    // delete job /////////////////////////////////////////////////////////
    processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
    jobId = managementService.createJobQuery().singleResult().getId();
    executeAvailableJobs();
    managementService.deleteJob(jobId);
    // asc
    query = historyService.createHistoricJobLogQuery().jobId(jobId).orderPartiallyByOccurrence().asc();
    verifyQueryWithOrdering(query, 5, historicJobLogPartiallyByOccurence());
    // desc
    query = historyService.createHistoricJobLogQuery().jobId(jobId).orderPartiallyByOccurrence().desc();
    verifyQueryWithOrdering(query, 5, inverted(historicJobLogPartiallyByOccurence()));
}
Also used : HistoricJobLogQuery(org.camunda.bpm.engine.history.HistoricJobLogQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 62 with HistoricJobLogQuery

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

the class HistoricJobLogQueryTest method testQueryByLogId.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml" })
public void testQueryByLogId() {
    runtimeService.startProcessInstanceByKey("process");
    String logId = historyService.createHistoricJobLogQuery().singleResult().getId();
    HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().logId(logId);
    verifyQueryResults(query, 1);
}
Also used : HistoricJobLogQuery(org.camunda.bpm.engine.history.HistoricJobLogQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 63 with HistoricJobLogQuery

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

the class HistoricJobLogQueryTest method testQueryByJobId.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml" })
public void testQueryByJobId() {
    runtimeService.startProcessInstanceByKey("process");
    String jobId = managementService.createJobQuery().singleResult().getId();
    HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().jobId(jobId);
    verifyQueryResults(query, 1);
}
Also used : HistoricJobLogQuery(org.camunda.bpm.engine.history.HistoricJobLogQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 64 with HistoricJobLogQuery

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

the class HistoricJobLogQueryTest method testQueryByCreationLog.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml" })
public void testQueryByCreationLog() {
    runtimeService.startProcessInstanceByKey("process");
    HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().creationLog();
    verifyQueryResults(query, 1);
}
Also used : HistoricJobLogQuery(org.camunda.bpm.engine.history.HistoricJobLogQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 65 with HistoricJobLogQuery

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

the class HistoricJobLogQueryTest method testQueryByJobDefinitionType.

@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml" })
public void testQueryByJobDefinitionType() {
    runtimeService.startProcessInstanceByKey("process");
    HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().jobDefinitionType(AsyncContinuationJobHandler.TYPE);
    verifyQueryResults(query, 1);
}
Also used : HistoricJobLogQuery(org.camunda.bpm.engine.history.HistoricJobLogQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

HistoricJobLogQuery (org.camunda.bpm.engine.history.HistoricJobLogQuery)65 Deployment (org.camunda.bpm.engine.test.Deployment)28 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)17 HistoricJobLog (org.camunda.bpm.engine.history.HistoricJobLog)12 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)1 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 HistoricJobLogDto (org.camunda.bpm.engine.rest.dto.history.HistoricJobLogDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1 Task (org.camunda.bpm.engine.task.Task)1 Test (org.junit.Test)1