Search in sources :

Example 11 with CustomFieldValueReport

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

the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithStateFilter.

@Test
public void testEachItemOfCustomFieldValueReportWithStateFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TaskState> states = Collections.singletonList(TaskState.READY);
    CustomField customField = CustomField.CUSTOM_1;
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, states, 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, 0 }, 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, 0 }, row3);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomFieldValueReport(pro.taskana.impl.report.impl.CustomFieldValueReport) CustomField(pro.taskana.CustomField) TaskState(pro.taskana.TaskState) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 12 with CustomFieldValueReport

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

use of pro.taskana.impl.report.impl.CustomFieldValueReport 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)

Aggregations

CustomFieldValueReport (pro.taskana.impl.report.impl.CustomFieldValueReport)13 Test (org.junit.Test)12 CustomField (pro.taskana.CustomField)12 TaskMonitorService (pro.taskana.TaskMonitorService)10 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)10 TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)9 TaskState (pro.taskana.TaskState)3 DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)3 MonitorQueryItem (pro.taskana.impl.report.impl.MonitorQueryItem)3 ArrayList (java.util.ArrayList)2 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)1