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);
}
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);
}
Aggregations