Search in sources :

Example 56 with TimeIntervalColumnHeader

use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader in project taskana by Taskana.

the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReport.

@Test
public void testEachItemOfCustomFieldValueReport() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CustomField customField = CustomField.CUSTOM_1;
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
    assertArrayEquals(new int[] { 11, 4, 3, 4, 3 }, row1);
    int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
    assertArrayEquals(new int[] { 5, 3, 0, 2, 0 }, row2);
    int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
    assertArrayEquals(new int[] { 3, 4, 1, 1, 6 }, row3);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomFieldValueReport(pro.taskana.impl.report.impl.CustomFieldValueReport) CustomField(pro.taskana.CustomField) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 57 with TimeIntervalColumnHeader

use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader in project taskana by Taskana.

the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportNotInWorkingDays.

@Test
public void testEachItemOfCustomFieldValueReportNotInWorkingDays() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CustomField customField = CustomField.CUSTOM_1;
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null, columnHeaders, false);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
    assertArrayEquals(new int[] { 15, 0, 3, 0, 7 }, row1);
    int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
    assertArrayEquals(new int[] { 8, 0, 0, 0, 2 }, row2);
    int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
    assertArrayEquals(new int[] { 7, 0, 1, 0, 7 }, row3);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomFieldValueReport(pro.taskana.impl.report.impl.CustomFieldValueReport) CustomField(pro.taskana.CustomField) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 58 with TimeIntervalColumnHeader

use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader 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 59 with TimeIntervalColumnHeader

use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader 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 60 with TimeIntervalColumnHeader

use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader in project taskana by Taskana.

the class ProvideClassificationReportAccTest method getShortListOfColumnHeaders.

private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
    List<TimeIntervalColumnHeader> reportLineItemDefinitions = new ArrayList<>();
    reportLineItemDefinitions.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -6));
    reportLineItemDefinitions.add(new TimeIntervalColumnHeader(-5, -1));
    reportLineItemDefinitions.add(new TimeIntervalColumnHeader(0));
    reportLineItemDefinitions.add(new TimeIntervalColumnHeader(1, 5));
    reportLineItemDefinitions.add(new TimeIntervalColumnHeader(6, Integer.MAX_VALUE));
    return reportLineItemDefinitions;
}
Also used : ArrayList(java.util.ArrayList) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader)

Aggregations

TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)75 Test (org.junit.Test)57 TaskMonitorService (pro.taskana.TaskMonitorService)46 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)46 ArrayList (java.util.ArrayList)25 CustomField (pro.taskana.CustomField)19 DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)13 TaskState (pro.taskana.TaskState)12 DetailedClassificationReport (pro.taskana.impl.report.impl.DetailedClassificationReport)10 CategoryReport (pro.taskana.impl.report.impl.CategoryReport)9 ClassificationReport (pro.taskana.impl.report.impl.ClassificationReport)9 CustomFieldValueReport (pro.taskana.impl.report.impl.CustomFieldValueReport)9 WorkbasketLevelReport (pro.taskana.impl.report.impl.WorkbasketLevelReport)9 DetailedReportRow (pro.taskana.impl.report.impl.DetailedReportRow)8 SelectedItem (pro.taskana.impl.SelectedItem)6 AbstractAccTest (acceptance.AbstractAccTest)4 DaysToWorkingDaysConverter (pro.taskana.impl.DaysToWorkingDaysConverter)4 MonitorQueryItem (pro.taskana.impl.report.impl.MonitorQueryItem)4 WithAccessId (pro.taskana.security.WithAccessId)4 Task (pro.taskana.Task)3