Search in sources :

Example 6 with HistoricTaskInstanceReportResult

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

the class HistoricTaskReportTest method testReportWithEmptyTaskName.

@Test
public void testReportWithEmptyTaskName() {
    // given
    startAndCompleteProcessInstance(PROCESS_DEFINITION_KEY, 2016, 7, 14, 12, 1);
    // when
    BpmnModelInstance instance = Bpmn.createExecutableProcess(ANOTHER_PROCESS_DEFINITION_KEY).name("name_" + ANOTHER_PROCESS_DEFINITION_KEY).startEvent().userTask("task1_" + ANOTHER_PROCESS_DEFINITION_KEY).name("").endEvent().done();
    processEngineTestRule.deploy(instance);
    startAndCompleteProcessInstance(ANOTHER_PROCESS_DEFINITION_KEY, 2016, 7, 14, 12, 1);
    Calendar calendar = Calendar.getInstance();
    calendar.set(2016, 11, 14, 12, 5);
    List<HistoricTaskInstanceReportResult> historicTaskInstanceReportResults = historyService.createHistoricTaskInstanceReport().completedBefore(calendar.getTime()).countByTaskName();
    assertEquals(1, historicTaskInstanceReportResults.size());
    assertEquals(1, historicTaskInstanceReportResults.get(0).getCount(), 0);
}
Also used : Calendar(java.util.Calendar) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance) HistoricTaskInstanceReportResult(org.camunda.bpm.engine.history.HistoricTaskInstanceReportResult) Test(org.junit.Test)

Example 7 with HistoricTaskInstanceReportResult

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

the class HistoricTaskReportTest method testHistoricTaskInstanceReportWithCompletedAfterDate.

@Test
public void testHistoricTaskInstanceReportWithCompletedAfterDate() {
    // given
    startAndCompleteProcessInstance(PROCESS_DEFINITION_KEY, 2016, 7, 14, 12, 1);
    startAndCompleteProcessInstance(PROCESS_DEFINITION_KEY, 2016, 8, 14, 12, 1);
    startAndCompleteProcessInstance(ANOTHER_PROCESS_DEFINITION_KEY, 2016, 7, 14, 12, 1);
    // when
    Calendar calendar = Calendar.getInstance();
    calendar.set(2016, 11, 14, 12, 5);
    List<HistoricTaskInstanceReportResult> historicTaskInstanceReportResults = historyService.createHistoricTaskInstanceReport().completedAfter(calendar.getTime()).countByProcessDefinitionKey();
    // then
    assertEquals(1, historicTaskInstanceReportResults.size());
    assertEquals(1, historicTaskInstanceReportResults.get(0).getCount(), 0);
}
Also used : Calendar(java.util.Calendar) HistoricTaskInstanceReportResult(org.camunda.bpm.engine.history.HistoricTaskInstanceReportResult) Test(org.junit.Test)

Aggregations

HistoricTaskInstanceReportResult (org.camunda.bpm.engine.history.HistoricTaskInstanceReportResult)7 Calendar (java.util.Calendar)4 Test (org.junit.Test)4 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)2 Date (java.util.Date)1 DurationReportResult (org.camunda.bpm.engine.history.DurationReportResult)1 HistoricTaskInstanceReport (org.camunda.bpm.engine.history.HistoricTaskInstanceReport)1 MockProvider.createMockHistoricTaskInstanceReport (org.camunda.bpm.engine.rest.helper.MockProvider.createMockHistoricTaskInstanceReport)1