Search in sources :

Example 6 with WorkbasketLevelReport

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

the class TaskMonitorServiceImpl method getWorkbasketLevelReport.

@Override
public WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states, List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues, List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays) throws InvalidArgumentException {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("entry to getWorkbasketLevelReport(workbasketIds = {}, states = {}, categories = {}, " + "domains = {}, customField = {}, customFieldValues = {}, columnHeaders = {}, " + "inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states), LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField, LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders), inWorkingDays);
    }
    try {
        taskanaEngineImpl.openConnection();
        configureDaysToWorkingDaysConverter();
        WorkbasketLevelReport report = new WorkbasketLevelReport(columnHeaders);
        List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfWorkbaskets(workbasketIds, states, categories, domains, customField, customFieldValues);
        report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
        return report;
    } finally {
        taskanaEngineImpl.returnConnection();
        LOGGER.debug("exit from getWorkbasketLevelReport().");
    }
}
Also used : WorkbasketLevelReport(pro.taskana.impl.report.impl.WorkbasketLevelReport) MonitorQueryItem(pro.taskana.impl.report.impl.MonitorQueryItem) DetailedMonitorQueryItem(pro.taskana.impl.report.impl.DetailedMonitorQueryItem)

Example 7 with WorkbasketLevelReport

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

the class ProvideWorkbasketLevelReportAccTest method testGetWorkbasketLevelReportWithReportLineItemDefinitions.

@Test
public void testGetWorkbasketLevelReportWithReportLineItemDefinitions() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
    WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    int sumLineCount = IntStream.of(report.getSumRow().getCells()).sum();
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    assertEquals(20, report.getRow("USER_1_1").getTotalValue());
    assertEquals(20, report.getRow("USER_1_2").getTotalValue());
    assertEquals(10, report.getRow("USER_1_3").getTotalValue());
    int[] sumRow = report.getSumRow().getCells();
    assertArrayEquals(new int[] { 10, 9, 11, 0, 4, 0, 7, 4, 5 }, sumRow);
    assertEquals(50, report.getSumRow().getTotalValue());
    assertEquals(50, sumLineCount);
}
Also used : WorkbasketLevelReport(pro.taskana.impl.report.impl.WorkbasketLevelReport) TaskMonitorService(pro.taskana.TaskMonitorService) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 8 with WorkbasketLevelReport

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

the class ProvideWorkbasketLevelReportAccTest method testEachItemOfWorkbasketLevelReportWithStateFilter.

@Test
public void testEachItemOfWorkbasketLevelReportWithStateFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TaskState> states = Collections.singletonList(TaskState.READY);
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, states, null, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    int[] row1 = report.getRow("USER_1_1").getCells();
    assertArrayEquals(new int[] { 13, 3, 1, 1, 0 }, row1);
    int[] row2 = report.getRow("USER_1_2").getCells();
    assertArrayEquals(new int[] { 4, 6, 3, 6, 0 }, row2);
    int[] row3 = report.getRow("USER_1_3").getCells();
    assertArrayEquals(new int[] { 2, 2, 0, 0, 0 }, row3);
}
Also used : WorkbasketLevelReport(pro.taskana.impl.report.impl.WorkbasketLevelReport) TaskMonitorService(pro.taskana.TaskMonitorService) TaskState(pro.taskana.TaskState) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 9 with WorkbasketLevelReport

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

the class ProvideWorkbasketLevelReportAccTest method testEachItemOfWorkbasketLevelReportWithDomainFilter.

@Test
public void testEachItemOfWorkbasketLevelReportWithDomainFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> domains = Collections.singletonList("DOMAIN_A");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, domains, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    int[] row1 = report.getRow("USER_1_1").getCells();
    assertArrayEquals(new int[] { 8, 1, 0, 1, 2 }, row1);
    int[] row2 = report.getRow("USER_1_2").getCells();
    assertArrayEquals(new int[] { 2, 2, 2, 4, 0 }, row2);
    int[] row3 = report.getRow("USER_1_3").getCells();
    assertArrayEquals(new int[] { 1, 1, 0, 0, 2 }, row3);
}
Also used : WorkbasketLevelReport(pro.taskana.impl.report.impl.WorkbasketLevelReport) TaskMonitorService(pro.taskana.TaskMonitorService) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 10 with WorkbasketLevelReport

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

the class ProvideWorkbasketLevelReportAccTest method testEachItemOfWorkbasketLevelReportWithCategoryFilter.

@Test
public void testEachItemOfWorkbasketLevelReportWithCategoryFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, categories, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    int[] row1 = report.getRow("USER_1_1").getCells();
    assertArrayEquals(new int[] { 3, 1, 1, 1, 2 }, row1);
    int[] row2 = report.getRow("USER_1_2").getCells();
    assertArrayEquals(new int[] { 1, 1, 1, 0, 1 }, row2);
    int[] row3 = report.getRow("USER_1_3").getCells();
    assertArrayEquals(new int[] { 0, 1, 0, 0, 4 }, row3);
}
Also used : WorkbasketLevelReport(pro.taskana.impl.report.impl.WorkbasketLevelReport) TaskMonitorService(pro.taskana.TaskMonitorService) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Aggregations

WorkbasketLevelReport (pro.taskana.impl.report.impl.WorkbasketLevelReport)12 Test (org.junit.Test)11 TaskMonitorService (pro.taskana.TaskMonitorService)9 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)9 TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)9 CustomField (pro.taskana.CustomField)3 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