Search in sources :

Example 41 with TaskMonitorService

use of pro.taskana.TaskMonitorService in project taskana by Taskana.

the class ProvideTaskStatusReportAccTest method testCompleteTaskStatusReport.

@Test
public void testCompleteTaskStatusReport() {
    // given
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    // when
    TaskStatusReport report = taskMonitorService.getTaskStatusReport();
    // then
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    ReportRow<TaskQueryItem> row1 = report.getRow("DOMAIN_A");
    assertArrayEquals(new int[] { 22, 4, 0 }, row1.getCells());
    assertEquals(26, row1.getTotalValue());
    ReportRow<TaskQueryItem> row2 = report.getRow("DOMAIN_B");
    assertArrayEquals(new int[] { 9, 3, 0 }, row2.getCells());
    assertEquals(12, row2.getTotalValue());
    ReportRow<TaskQueryItem> row3 = report.getRow("DOMAIN_C");
    assertArrayEquals(new int[] { 10, 2, 0 }, row3.getCells());
    assertEquals(12, row3.getTotalValue());
    ReportRow<TaskQueryItem> sumRow = report.getSumRow();
    assertArrayEquals(new int[] { 41, 9, 0 }, sumRow.getCells());
    assertEquals(50, sumRow.getTotalValue());
}
Also used : TaskQueryItem(pro.taskana.impl.report.impl.TaskQueryItem) TaskMonitorService(pro.taskana.TaskMonitorService) TaskStatusReport(pro.taskana.impl.report.impl.TaskStatusReport) Test(org.junit.Test) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)

Example 42 with TaskMonitorService

use of pro.taskana.TaskMonitorService in project taskana by Taskana.

the class ProvideTaskStatusReportAccTest method testCompleteTaskStatusReportWithDomainFilter.

@Test
public void testCompleteTaskStatusReportWithDomainFilter() {
    // given
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    // when
    TaskStatusReport report = taskMonitorService.getTaskStatusReport(asList("DOMAIN_C", "DOMAIN_A"));
    // then
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report));
    }
    assertNotNull(report);
    assertEquals(2, report.rowSize());
    ReportRow<TaskQueryItem> row1 = report.getRow("DOMAIN_A");
    assertArrayEquals(new int[] { 22, 4, 0 }, row1.getCells());
    assertEquals(26, row1.getTotalValue());
    ReportRow<TaskQueryItem> row2 = report.getRow("DOMAIN_C");
    assertArrayEquals(new int[] { 10, 2, 0 }, row2.getCells());
    assertEquals(12, row2.getTotalValue());
    ReportRow<TaskQueryItem> sumRow = report.getSumRow();
    assertArrayEquals(new int[] { 32, 6, 0 }, sumRow.getCells());
    assertEquals(38, sumRow.getTotalValue());
}
Also used : TaskQueryItem(pro.taskana.impl.report.impl.TaskQueryItem) TaskMonitorService(pro.taskana.TaskMonitorService) TaskStatusReport(pro.taskana.impl.report.impl.TaskStatusReport) Test(org.junit.Test) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)

Example 43 with TaskMonitorService

use of pro.taskana.TaskMonitorService in project taskana by Taskana.

the class GetTaskIdsOfCategoryReportAccTest method testGetTaskIdsOfCategoryReportWithDomainFilter.

@Test
public void testGetTaskIdsOfCategoryReportWithDomainFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> domains = Collections.singletonList("DOMAIN_A");
    List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
    List<SelectedItem> selectedItems = new ArrayList<>();
    SelectedItem s1 = new SelectedItem();
    s1.setKey("EXTERN");
    s1.setLowerAgeLimit(-5);
    s1.setUpperAgeLimit(-2);
    selectedItems.add(s1);
    SelectedItem s2 = new SelectedItem();
    s2.setKey("AUTOMATIC");
    s2.setLowerAgeLimit(Integer.MIN_VALUE);
    s2.setUpperAgeLimit(-11);
    selectedItems.add(s2);
    SelectedItem s3 = new SelectedItem();
    s3.setKey("MANUAL");
    s3.setLowerAgeLimit(0);
    s3.setUpperAgeLimit(0);
    selectedItems.add(s3);
    List<String> ids = taskMonitorService.getTaskIdsOfCategoryReportLineItems(null, null, null, domains, null, null, columnHeaders, selectedItems);
    assertEquals(4, ids.size());
    assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000021"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000022"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000028"));
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) ArrayList(java.util.ArrayList) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) SelectedItem(pro.taskana.impl.SelectedItem) Test(org.junit.Test) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)

Example 44 with TaskMonitorService

use of pro.taskana.TaskMonitorService in project taskana by Taskana.

the class GetTaskIdsOfCategoryReportAccTest method testGetTaskIdsOfCategoryReportWithCustomFieldValueFilter.

@Test
public void testGetTaskIdsOfCategoryReportWithCustomFieldValueFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CustomField customField = CustomField.CUSTOM_1;
    List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
    List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
    List<SelectedItem> selectedItems = new ArrayList<>();
    SelectedItem s1 = new SelectedItem();
    s1.setKey("EXTERN");
    s1.setLowerAgeLimit(-5);
    s1.setUpperAgeLimit(-2);
    selectedItems.add(s1);
    SelectedItem s2 = new SelectedItem();
    s2.setKey("AUTOMATIC");
    s2.setLowerAgeLimit(Integer.MIN_VALUE);
    s2.setUpperAgeLimit(-11);
    selectedItems.add(s2);
    SelectedItem s3 = new SelectedItem();
    s3.setKey("MANUAL");
    s3.setLowerAgeLimit(0);
    s3.setUpperAgeLimit(0);
    selectedItems.add(s3);
    List<String> ids = taskMonitorService.getTaskIdsOfCategoryReportLineItems(null, null, null, null, customField, customFieldValues, columnHeaders, selectedItems);
    assertEquals(5, ids.size());
    assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomField(pro.taskana.CustomField) ArrayList(java.util.ArrayList) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) SelectedItem(pro.taskana.impl.SelectedItem) Test(org.junit.Test) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)

Example 45 with TaskMonitorService

use of pro.taskana.TaskMonitorService in project taskana by Taskana.

the class ProvideClassificationReportAccTest method testEachItemOfClassificationReportWithCustomFieldValueFilter.

@Test
public void testEachItemOfClassificationReportWithCustomFieldValueFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CustomField customField = CustomField.CUSTOM_1;
    List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, customField, customFieldValues, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    int[] row1 = report.getRow("L10000").getCells();
    assertArrayEquals(new int[] { 4, 0, 0, 0, 0 }, row1);
    int[] row2 = report.getRow("L20000").getCells();
    assertArrayEquals(new int[] { 4, 1, 1, 1, 0 }, row2);
    int[] row3 = report.getRow("L30000").getCells();
    assertArrayEquals(new int[] { 1, 0, 0, 1, 1 }, row3);
    int[] row4 = report.getRow("L40000").getCells();
    assertArrayEquals(new int[] { 1, 1, 2, 0, 2 }, row4);
    int[] row5 = report.getRow("L50000").getCells();
    assertArrayEquals(new int[] { 1, 2, 0, 2, 0 }, row5);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomField(pro.taskana.CustomField) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) ClassificationReport(pro.taskana.impl.report.impl.ClassificationReport) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)55 TaskMonitorService (pro.taskana.TaskMonitorService)55 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)55 TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)46 CustomField (pro.taskana.CustomField)15 CustomFieldValueReport (pro.taskana.impl.report.impl.CustomFieldValueReport)10 CategoryReport (pro.taskana.impl.report.impl.CategoryReport)9 ClassificationReport (pro.taskana.impl.report.impl.ClassificationReport)9 DetailedClassificationReport (pro.taskana.impl.report.impl.DetailedClassificationReport)9 WorkbasketLevelReport (pro.taskana.impl.report.impl.WorkbasketLevelReport)9 DetailedReportRow (pro.taskana.impl.report.impl.DetailedReportRow)8 DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)7 ArrayList (java.util.ArrayList)6 TaskState (pro.taskana.TaskState)6 SelectedItem (pro.taskana.impl.SelectedItem)6 TaskQueryItem (pro.taskana.impl.report.impl.TaskQueryItem)3 TaskStatusReport (pro.taskana.impl.report.impl.TaskStatusReport)3