Search in sources :

Example 11 with MonitorQueryItem

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

the class TaskMonitorServiceImpl method getClassificationReport.

@Override
public ClassificationReport getClassificationReport(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 getClassificationReport(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();
        ClassificationReport report = new ClassificationReport(columnHeaders);
        List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfClassifications(workbasketIds, states, categories, domains, customField, customFieldValues);
        report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
        return report;
    } finally {
        taskanaEngineImpl.returnConnection();
        LOGGER.debug("exit from getClassificationReport().");
    }
}
Also used : MonitorQueryItem(pro.taskana.impl.report.impl.MonitorQueryItem) DetailedMonitorQueryItem(pro.taskana.impl.report.impl.DetailedMonitorQueryItem) ClassificationReport(pro.taskana.impl.report.impl.ClassificationReport) DetailedClassificationReport(pro.taskana.impl.report.impl.DetailedClassificationReport)

Example 12 with MonitorQueryItem

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

the class TaskMonitorServiceImpl method getCustomFieldValueReport.

@Override
public CustomFieldValueReport getCustomFieldValueReport(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 getCustomFieldValueReport(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();
        if (customField == null) {
            throw new InvalidArgumentException("CustomField canĀ“t be used as NULL-Parameter");
        }
        configureDaysToWorkingDaysConverter();
        CustomFieldValueReport report = new CustomFieldValueReport(columnHeaders);
        List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfCustomFieldValues(workbasketIds, states, categories, domains, customField, customFieldValues);
        report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
        return report;
    } finally {
        taskanaEngineImpl.returnConnection();
        LOGGER.debug("exit from getCustomFieldValueReport().");
    }
}
Also used : InvalidArgumentException(pro.taskana.exceptions.InvalidArgumentException) CustomFieldValueReport(pro.taskana.impl.report.impl.CustomFieldValueReport) MonitorQueryItem(pro.taskana.impl.report.impl.MonitorQueryItem) DetailedMonitorQueryItem(pro.taskana.impl.report.impl.DetailedMonitorQueryItem)

Aggregations

DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)12 MonitorQueryItem (pro.taskana.impl.report.impl.MonitorQueryItem)12 ArrayList (java.util.ArrayList)8 Test (org.junit.Test)8 CustomField (pro.taskana.CustomField)8 TaskState (pro.taskana.TaskState)8 TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)4 CategoryReport (pro.taskana.impl.report.impl.CategoryReport)3 ClassificationReport (pro.taskana.impl.report.impl.ClassificationReport)3 CustomFieldValueReport (pro.taskana.impl.report.impl.CustomFieldValueReport)3 DetailedClassificationReport (pro.taskana.impl.report.impl.DetailedClassificationReport)3 WorkbasketLevelReport (pro.taskana.impl.report.impl.WorkbasketLevelReport)3 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)1