TSK-569: Convert Windows line endings (CRLF) to Unix line endings (LF)
This commit is contained in:
parent
1af5acfbd5
commit
ecd88201fb
|
@ -1,23 +1,23 @@
|
||||||
package pro.taskana;
|
package pro.taskana;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This enum contains the fields CUSTOM_1 - CUSTOM_10 for the task entity.
|
* This enum contains the fields CUSTOM_1 - CUSTOM_10 for the task entity.
|
||||||
*/
|
*/
|
||||||
public enum CustomField {
|
public enum CustomField {
|
||||||
CUSTOM_1,
|
CUSTOM_1,
|
||||||
CUSTOM_2,
|
CUSTOM_2,
|
||||||
CUSTOM_3,
|
CUSTOM_3,
|
||||||
CUSTOM_4,
|
CUSTOM_4,
|
||||||
CUSTOM_5,
|
CUSTOM_5,
|
||||||
CUSTOM_6,
|
CUSTOM_6,
|
||||||
CUSTOM_7,
|
CUSTOM_7,
|
||||||
CUSTOM_8,
|
CUSTOM_8,
|
||||||
CUSTOM_9,
|
CUSTOM_9,
|
||||||
CUSTOM_10,
|
CUSTOM_10,
|
||||||
CUSTOM_11,
|
CUSTOM_11,
|
||||||
CUSTOM_12,
|
CUSTOM_12,
|
||||||
CUSTOM_13,
|
CUSTOM_13,
|
||||||
CUSTOM_14,
|
CUSTOM_14,
|
||||||
CUSTOM_15,
|
CUSTOM_15,
|
||||||
CUSTOM_16
|
CUSTOM_16
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,13 +1,13 @@
|
||||||
package pro.taskana.exceptions;
|
package pro.taskana.exceptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This exception will be thrown if the database name doesn't match to one of the desired databases.
|
* This exception will be thrown if the database name doesn't match to one of the desired databases.
|
||||||
*/
|
*/
|
||||||
public class UnsupportedDatabaseException extends RuntimeException {
|
public class UnsupportedDatabaseException extends RuntimeException {
|
||||||
|
|
||||||
public UnsupportedDatabaseException(String name) {
|
public UnsupportedDatabaseException(String name) {
|
||||||
super("Database with '" + name + "' not found");
|
super("Database with '" + name + "' not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,329 +1,329 @@
|
||||||
package pro.taskana.impl;
|
package pro.taskana.impl;
|
||||||
|
|
||||||
import java.time.DayOfWeek;
|
import java.time.DayOfWeek;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
||||||
import pro.taskana.exceptions.InvalidArgumentException;
|
import pro.taskana.exceptions.InvalidArgumentException;
|
||||||
import pro.taskana.impl.util.LoggerUtils;
|
import pro.taskana.impl.util.LoggerUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DaysToWorkingDaysConverter provides a method to convert an age in days into an age in working days. Before the
|
* The DaysToWorkingDaysConverter provides a method to convert an age in days into an age in working days. Before the
|
||||||
* method convertDaysToWorkingDays() can be used, the DaysToWorkingDaysConverter has to be initialized. For a list of
|
* method convertDaysToWorkingDays() can be used, the DaysToWorkingDaysConverter has to be initialized. For a list of
|
||||||
* {@link TimeIntervalColumnHeader}s the converter creates a "table" with integer that represents the age in days from
|
* {@link TimeIntervalColumnHeader}s the converter creates a "table" with integer that represents the age in days from
|
||||||
* the largest lower limit until the smallest upper limit of the timeIntervalColumnHeaders. This table is valid for a
|
* the largest lower limit until the smallest upper limit of the timeIntervalColumnHeaders. This table is valid for a
|
||||||
* whole day until the converter is initialized with bigger limits.
|
* whole day until the converter is initialized with bigger limits.
|
||||||
*/
|
*/
|
||||||
public final class DaysToWorkingDaysConverter {
|
public final class DaysToWorkingDaysConverter {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskMonitorServiceImpl.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(TaskMonitorServiceImpl.class);
|
||||||
private static DaysToWorkingDaysConverter instance;
|
private static DaysToWorkingDaysConverter instance;
|
||||||
private static ArrayList<Integer> positiveDaysToWorkingDays;
|
private static ArrayList<Integer> positiveDaysToWorkingDays;
|
||||||
private static ArrayList<Integer> negativeDaysToWorkingDays;
|
private static ArrayList<Integer> negativeDaysToWorkingDays;
|
||||||
private static Instant dateCreated;
|
private static Instant dateCreated;
|
||||||
private static LocalDate easterSunday;
|
private static LocalDate easterSunday;
|
||||||
private static boolean germanHolidaysEnabled;
|
private static boolean germanHolidaysEnabled;
|
||||||
private static List<LocalDate> customHolidays;
|
private static List<LocalDate> customHolidays;
|
||||||
|
|
||||||
private DaysToWorkingDaysConverter(List<TimeIntervalColumnHeader> columnHeaders,
|
private DaysToWorkingDaysConverter(List<TimeIntervalColumnHeader> columnHeaders,
|
||||||
Instant referenceDate) {
|
Instant referenceDate) {
|
||||||
easterSunday = getEasterSunday(LocalDateTime.ofInstant(referenceDate, ZoneId.systemDefault()).getYear());
|
easterSunday = getEasterSunday(LocalDateTime.ofInstant(referenceDate, ZoneId.systemDefault()).getYear());
|
||||||
dateCreated = referenceDate;
|
dateCreated = referenceDate;
|
||||||
positiveDaysToWorkingDays = generatePositiveDaysToWorkingDays(columnHeaders, referenceDate);
|
positiveDaysToWorkingDays = generatePositiveDaysToWorkingDays(columnHeaders, referenceDate);
|
||||||
negativeDaysToWorkingDays = generateNegativeDaysToWorkingDays(columnHeaders, referenceDate);
|
negativeDaysToWorkingDays = generateNegativeDaysToWorkingDays(columnHeaders, referenceDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the DaysToWorkingDaysConverter for a list of {@link TimeIntervalColumnHeader}s and the current day. A
|
* Initializes the DaysToWorkingDaysConverter for a list of {@link TimeIntervalColumnHeader}s and the current day. A
|
||||||
* new table is only created if there are bigger limits or the date has changed.
|
* new table is only created if there are bigger limits or the date has changed.
|
||||||
*
|
*
|
||||||
* @param columnHeaders
|
* @param columnHeaders
|
||||||
* a list of {@link TimeIntervalColumnHeader}s that determines the size of the table
|
* a list of {@link TimeIntervalColumnHeader}s that determines the size of the table
|
||||||
* @return an instance of the DaysToWorkingDaysConverter
|
* @return an instance of the DaysToWorkingDaysConverter
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
* thrown if columnHeaders is null
|
* thrown if columnHeaders is null
|
||||||
*/
|
*/
|
||||||
public static DaysToWorkingDaysConverter initialize(List<TimeIntervalColumnHeader> columnHeaders)
|
public static DaysToWorkingDaysConverter initialize(List<TimeIntervalColumnHeader> columnHeaders)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
return initialize(columnHeaders, Instant.now());
|
return initialize(columnHeaders, Instant.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the DaysToWorkingDaysConverter for a list of {@link TimeIntervalColumnHeader}s and a referenceDate. A
|
* Initializes the DaysToWorkingDaysConverter for a list of {@link TimeIntervalColumnHeader}s and a referenceDate. A
|
||||||
* new table is only created if there are bigger limits or the date has changed.
|
* new table is only created if there are bigger limits or the date has changed.
|
||||||
*
|
*
|
||||||
* @param columnHeaders
|
* @param columnHeaders
|
||||||
* a list of {@link TimeIntervalColumnHeader}s that determines the size of the table
|
* a list of {@link TimeIntervalColumnHeader}s that determines the size of the table
|
||||||
* @param referenceDate
|
* @param referenceDate
|
||||||
* a {@link Instant} that represents the current day of the table
|
* a {@link Instant} that represents the current day of the table
|
||||||
* @return an instance of the DaysToWorkingDaysConverter
|
* @return an instance of the DaysToWorkingDaysConverter
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
* thrown if columnHeaders or referenceDate is null
|
* thrown if columnHeaders or referenceDate is null
|
||||||
*/
|
*/
|
||||||
public static DaysToWorkingDaysConverter initialize(List<TimeIntervalColumnHeader> columnHeaders,
|
public static DaysToWorkingDaysConverter initialize(List<TimeIntervalColumnHeader> columnHeaders,
|
||||||
Instant referenceDate) throws InvalidArgumentException {
|
Instant referenceDate) throws InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("Initialize DaysToWorkingDaysConverter with columnHeaders: {}",
|
LOGGER.debug("Initialize DaysToWorkingDaysConverter with columnHeaders: {}",
|
||||||
LoggerUtils.listToString(columnHeaders));
|
LoggerUtils.listToString(columnHeaders));
|
||||||
}
|
}
|
||||||
if (columnHeaders == null) {
|
if (columnHeaders == null) {
|
||||||
throw new InvalidArgumentException("TimeIntervalColumnHeaders can´t be used as NULL-Parameter");
|
throw new InvalidArgumentException("TimeIntervalColumnHeaders can´t be used as NULL-Parameter");
|
||||||
}
|
}
|
||||||
if (referenceDate == null) {
|
if (referenceDate == null) {
|
||||||
throw new InvalidArgumentException("ReferenceDate can´t be used as NULL-Parameter");
|
throw new InvalidArgumentException("ReferenceDate can´t be used as NULL-Parameter");
|
||||||
}
|
}
|
||||||
int largesLowerLimit = getLargestLowerLimit(columnHeaders);
|
int largesLowerLimit = getLargestLowerLimit(columnHeaders);
|
||||||
int smallestUpperLimit = getSmallestUpperLimit(columnHeaders);
|
int smallestUpperLimit = getSmallestUpperLimit(columnHeaders);
|
||||||
if (instance == null
|
if (instance == null
|
||||||
|| !positiveDaysToWorkingDays.contains(largesLowerLimit)
|
|| !positiveDaysToWorkingDays.contains(largesLowerLimit)
|
||||||
|| !negativeDaysToWorkingDays.contains(smallestUpperLimit)
|
|| !negativeDaysToWorkingDays.contains(smallestUpperLimit)
|
||||||
|| !dateCreated.truncatedTo(ChronoUnit.DAYS).equals(referenceDate.truncatedTo(ChronoUnit.DAYS))) {
|
|| !dateCreated.truncatedTo(ChronoUnit.DAYS).equals(referenceDate.truncatedTo(ChronoUnit.DAYS))) {
|
||||||
|
|
||||||
instance = new DaysToWorkingDaysConverter(columnHeaders, referenceDate);
|
instance = new DaysToWorkingDaysConverter(columnHeaders, referenceDate);
|
||||||
LOGGER.debug("Create new converter for the values from {} until {} for the date: {}.", largesLowerLimit,
|
LOGGER.debug("Create new converter for the values from {} until {} for the date: {}.", largesLowerLimit,
|
||||||
smallestUpperLimit, dateCreated);
|
smallestUpperLimit, dateCreated);
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts an integer, that represents the age in days, to the age in working days by using the table that was
|
* Converts an integer, that represents the age in days, to the age in working days by using the table that was
|
||||||
* created by initialization. If the age in days is beyond the limits of the table, the integer will be returned
|
* created by initialization. If the age in days is beyond the limits of the table, the integer will be returned
|
||||||
* unchanged.
|
* unchanged.
|
||||||
*
|
*
|
||||||
* @param ageInDays
|
* @param ageInDays
|
||||||
* represents the age in days
|
* represents the age in days
|
||||||
* @return the age in working days
|
* @return the age in working days
|
||||||
*/
|
*/
|
||||||
public int convertDaysToWorkingDays(int ageInDays) {
|
public int convertDaysToWorkingDays(int ageInDays) {
|
||||||
|
|
||||||
int minDay = -(negativeDaysToWorkingDays.size() - 1);
|
int minDay = -(negativeDaysToWorkingDays.size() - 1);
|
||||||
int maxDay = positiveDaysToWorkingDays.size() - 1;
|
int maxDay = positiveDaysToWorkingDays.size() - 1;
|
||||||
|
|
||||||
if (ageInDays >= minDay && ageInDays <= 0) {
|
if (ageInDays >= minDay && ageInDays <= 0) {
|
||||||
return negativeDaysToWorkingDays.get(-ageInDays);
|
return negativeDaysToWorkingDays.get(-ageInDays);
|
||||||
}
|
}
|
||||||
if (ageInDays > 0 && ageInDays <= maxDay) {
|
if (ageInDays > 0 && ageInDays <= maxDay) {
|
||||||
return positiveDaysToWorkingDays.get(ageInDays);
|
return positiveDaysToWorkingDays.get(ageInDays);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ageInDays;
|
return ageInDays;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts an integer, that represents the age in working days, to the age in days by using the table that was
|
* Converts an integer, that represents the age in working days, to the age in days by using the table that was
|
||||||
* created by initialization. Because one age in working days could match to more than one age in days, the return
|
* created by initialization. Because one age in working days could match to more than one age in days, the return
|
||||||
* value is a list of all days that match to the input parameter. If the age in working days is beyond the limits of
|
* value is a list of all days that match to the input parameter. If the age in working days is beyond the limits of
|
||||||
* the table, the integer will be returned unchanged.
|
* the table, the integer will be returned unchanged.
|
||||||
*
|
*
|
||||||
* @param ageInWorkingDays
|
* @param ageInWorkingDays
|
||||||
* represents the age in working days
|
* represents the age in working days
|
||||||
* @return a list of age in days
|
* @return a list of age in days
|
||||||
*/
|
*/
|
||||||
public ArrayList<Integer> convertWorkingDaysToDays(int ageInWorkingDays) {
|
public ArrayList<Integer> convertWorkingDaysToDays(int ageInWorkingDays) {
|
||||||
|
|
||||||
ArrayList<Integer> list = new ArrayList<>();
|
ArrayList<Integer> list = new ArrayList<>();
|
||||||
|
|
||||||
int minWorkingDay = negativeDaysToWorkingDays.get(negativeDaysToWorkingDays.size() - 1);
|
int minWorkingDay = negativeDaysToWorkingDays.get(negativeDaysToWorkingDays.size() - 1);
|
||||||
int maxWorkingDay = positiveDaysToWorkingDays.get(positiveDaysToWorkingDays.size() - 1);
|
int maxWorkingDay = positiveDaysToWorkingDays.get(positiveDaysToWorkingDays.size() - 1);
|
||||||
|
|
||||||
if (ageInWorkingDays >= minWorkingDay && ageInWorkingDays < 0) {
|
if (ageInWorkingDays >= minWorkingDay && ageInWorkingDays < 0) {
|
||||||
for (int ageInDays = 0; ageInDays < negativeDaysToWorkingDays.size(); ageInDays++) {
|
for (int ageInDays = 0; ageInDays < negativeDaysToWorkingDays.size(); ageInDays++) {
|
||||||
if (negativeDaysToWorkingDays.get(ageInDays) == ageInWorkingDays) {
|
if (negativeDaysToWorkingDays.get(ageInDays) == ageInWorkingDays) {
|
||||||
list.add(-ageInDays);
|
list.add(-ageInDays);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
if (ageInWorkingDays > 0 && ageInWorkingDays <= maxWorkingDay) {
|
if (ageInWorkingDays > 0 && ageInWorkingDays <= maxWorkingDay) {
|
||||||
for (int ageInDays = 0; ageInDays < positiveDaysToWorkingDays.size(); ageInDays++) {
|
for (int ageInDays = 0; ageInDays < positiveDaysToWorkingDays.size(); ageInDays++) {
|
||||||
if (positiveDaysToWorkingDays.get(ageInDays) == ageInWorkingDays) {
|
if (positiveDaysToWorkingDays.get(ageInDays) == ageInWorkingDays) {
|
||||||
list.add(ageInDays);
|
list.add(ageInDays);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ageInWorkingDays == 0) {
|
if (ageInWorkingDays == 0) {
|
||||||
list.add(0);
|
list.add(0);
|
||||||
for (int ageInDays = 1; ageInDays < positiveDaysToWorkingDays.size(); ageInDays++) {
|
for (int ageInDays = 1; ageInDays < positiveDaysToWorkingDays.size(); ageInDays++) {
|
||||||
if (positiveDaysToWorkingDays.get(ageInDays) == ageInWorkingDays) {
|
if (positiveDaysToWorkingDays.get(ageInDays) == ageInWorkingDays) {
|
||||||
list.add(ageInDays);
|
list.add(ageInDays);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int ageInDays = 1; ageInDays < negativeDaysToWorkingDays.size(); ageInDays++) {
|
for (int ageInDays = 1; ageInDays < negativeDaysToWorkingDays.size(); ageInDays++) {
|
||||||
if (negativeDaysToWorkingDays.get(ageInDays) == ageInWorkingDays) {
|
if (negativeDaysToWorkingDays.get(ageInDays) == ageInWorkingDays) {
|
||||||
list.add(-ageInDays);
|
list.add(-ageInDays);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If ageInWorkingDays is beyond the limits of the table, the value is returned unchanged.
|
// If ageInWorkingDays is beyond the limits of the table, the value is returned unchanged.
|
||||||
list.add(ageInWorkingDays);
|
list.add(ageInWorkingDays);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long convertWorkingDaysToDays(Instant startTime, long numberOfDays) {
|
public long convertWorkingDaysToDays(Instant startTime, long numberOfDays) {
|
||||||
int days = 0;
|
int days = 0;
|
||||||
int workingDays = 0;
|
int workingDays = 0;
|
||||||
while (workingDays < numberOfDays) {
|
while (workingDays < numberOfDays) {
|
||||||
if (isWorkingDay(days, startTime)) {
|
if (isWorkingDay(days, startTime)) {
|
||||||
workingDays++;
|
workingDays++;
|
||||||
}
|
}
|
||||||
days++;
|
days++;
|
||||||
while (!isWorkingDay(days, startTime)) {
|
while (!isWorkingDay(days, startTime)) {
|
||||||
days++;
|
days++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return days;
|
return days;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList<Integer> generateNegativeDaysToWorkingDays(
|
private ArrayList<Integer> generateNegativeDaysToWorkingDays(
|
||||||
List<TimeIntervalColumnHeader> columnHeaders, Instant referenceDate) {
|
List<TimeIntervalColumnHeader> columnHeaders, Instant referenceDate) {
|
||||||
int minUpperLimit = getSmallestUpperLimit(columnHeaders);
|
int minUpperLimit = getSmallestUpperLimit(columnHeaders);
|
||||||
ArrayList<Integer> daysToWorkingDays = new ArrayList<>();
|
ArrayList<Integer> daysToWorkingDays = new ArrayList<>();
|
||||||
daysToWorkingDays.add(0);
|
daysToWorkingDays.add(0);
|
||||||
int day = -1;
|
int day = -1;
|
||||||
int workingDay = 0;
|
int workingDay = 0;
|
||||||
while (workingDay > minUpperLimit) {
|
while (workingDay > minUpperLimit) {
|
||||||
if (isWorkingDay(day, referenceDate)) {
|
if (isWorkingDay(day, referenceDate)) {
|
||||||
workingDay--;
|
workingDay--;
|
||||||
}
|
}
|
||||||
daysToWorkingDays.add(workingDay);
|
daysToWorkingDays.add(workingDay);
|
||||||
day--;
|
day--;
|
||||||
}
|
}
|
||||||
return daysToWorkingDays;
|
return daysToWorkingDays;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList<Integer> generatePositiveDaysToWorkingDays(
|
private ArrayList<Integer> generatePositiveDaysToWorkingDays(
|
||||||
List<TimeIntervalColumnHeader> columnHeaders, Instant referenceDate) {
|
List<TimeIntervalColumnHeader> columnHeaders, Instant referenceDate) {
|
||||||
int maxLowerLimit = getLargestLowerLimit(columnHeaders);
|
int maxLowerLimit = getLargestLowerLimit(columnHeaders);
|
||||||
ArrayList<Integer> daysToWorkingDays = new ArrayList<>();
|
ArrayList<Integer> daysToWorkingDays = new ArrayList<>();
|
||||||
daysToWorkingDays.add(0);
|
daysToWorkingDays.add(0);
|
||||||
|
|
||||||
int day = 1;
|
int day = 1;
|
||||||
int workingDay = 0;
|
int workingDay = 0;
|
||||||
while (workingDay < maxLowerLimit) {
|
while (workingDay < maxLowerLimit) {
|
||||||
if (isWorkingDay(day, referenceDate)) {
|
if (isWorkingDay(day, referenceDate)) {
|
||||||
workingDay++;
|
workingDay++;
|
||||||
}
|
}
|
||||||
daysToWorkingDays.add(workingDay);
|
daysToWorkingDays.add(workingDay);
|
||||||
day++;
|
day++;
|
||||||
}
|
}
|
||||||
return daysToWorkingDays;
|
return daysToWorkingDays;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getSmallestUpperLimit(List<TimeIntervalColumnHeader> columnHeaders) {
|
private static int getSmallestUpperLimit(List<TimeIntervalColumnHeader> columnHeaders) {
|
||||||
int smallestUpperLimit = 0;
|
int smallestUpperLimit = 0;
|
||||||
for (TimeIntervalColumnHeader columnHeader : columnHeaders) {
|
for (TimeIntervalColumnHeader columnHeader : columnHeaders) {
|
||||||
if (columnHeader.getUpperAgeLimit() < smallestUpperLimit) {
|
if (columnHeader.getUpperAgeLimit() < smallestUpperLimit) {
|
||||||
smallestUpperLimit = columnHeader.getUpperAgeLimit();
|
smallestUpperLimit = columnHeader.getUpperAgeLimit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return smallestUpperLimit;
|
return smallestUpperLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getLargestLowerLimit(List<TimeIntervalColumnHeader> columnHeaders) {
|
private static int getLargestLowerLimit(List<TimeIntervalColumnHeader> columnHeaders) {
|
||||||
int greatestLowerLimit = 0;
|
int greatestLowerLimit = 0;
|
||||||
for (TimeIntervalColumnHeader columnHeader : columnHeaders) {
|
for (TimeIntervalColumnHeader columnHeader : columnHeaders) {
|
||||||
if (columnHeader.getUpperAgeLimit() > greatestLowerLimit) {
|
if (columnHeader.getUpperAgeLimit() > greatestLowerLimit) {
|
||||||
greatestLowerLimit = columnHeader.getLowerAgeLimit();
|
greatestLowerLimit = columnHeader.getLowerAgeLimit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return greatestLowerLimit;
|
return greatestLowerLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isWorkingDay(int day, Instant referenceDate) {
|
private boolean isWorkingDay(int day, Instant referenceDate) {
|
||||||
LocalDateTime dateTime = LocalDateTime.ofInstant(referenceDate, ZoneId.systemDefault()).plusDays(day);
|
LocalDateTime dateTime = LocalDateTime.ofInstant(referenceDate, ZoneId.systemDefault()).plusDays(day);
|
||||||
if (dateTime.getDayOfWeek().equals(DayOfWeek.SATURDAY)
|
if (dateTime.getDayOfWeek().equals(DayOfWeek.SATURDAY)
|
||||||
|| dateTime.getDayOfWeek().equals(DayOfWeek.SUNDAY)
|
|| dateTime.getDayOfWeek().equals(DayOfWeek.SUNDAY)
|
||||||
|| isHoliday(dateTime.toLocalDate())) {
|
|| isHoliday(dateTime.toLocalDate())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isHoliday(LocalDate date) {
|
private boolean isHoliday(LocalDate date) {
|
||||||
if (germanHolidaysEnabled) {
|
if (germanHolidaysEnabled) {
|
||||||
// Fix and movable holidays that are valid throughout Germany: New years day, Labour Day, Day of German
|
// Fix and movable holidays that are valid throughout Germany: New years day, Labour Day, Day of German
|
||||||
// Unity, Christmas, Good Friday, Easter Monday, Ascension Day, Whit Monday.
|
// Unity, Christmas, Good Friday, Easter Monday, Ascension Day, Whit Monday.
|
||||||
if (date.getDayOfMonth() == 1 && date.getMonthValue() == 1
|
if (date.getDayOfMonth() == 1 && date.getMonthValue() == 1
|
||||||
|| date.getDayOfMonth() == 1 && date.getMonthValue() == 5
|
|| date.getDayOfMonth() == 1 && date.getMonthValue() == 5
|
||||||
|| date.getDayOfMonth() == 3 && date.getMonthValue() == 10
|
|| date.getDayOfMonth() == 3 && date.getMonthValue() == 10
|
||||||
|| date.getDayOfMonth() == 25 && date.getMonthValue() == 12
|
|| date.getDayOfMonth() == 25 && date.getMonthValue() == 12
|
||||||
|| date.getDayOfMonth() == 26 && date.getMonthValue() == 12
|
|| date.getDayOfMonth() == 26 && date.getMonthValue() == 12
|
||||||
|| easterSunday.minusDays(2).equals(date)
|
|| easterSunday.minusDays(2).equals(date)
|
||||||
|| easterSunday.plusDays(1).equals(date)
|
|| easterSunday.plusDays(1).equals(date)
|
||||||
|| easterSunday.plusDays(39).equals(date)
|
|| easterSunday.plusDays(39).equals(date)
|
||||||
|| easterSunday.plusDays(50).equals(date)) {
|
|| easterSunday.plusDays(50).equals(date)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (customHolidays != null) {
|
if (customHolidays != null) {
|
||||||
// Custom holidays that can be configured in the TaskanaEngineConfiguration
|
// Custom holidays that can be configured in the TaskanaEngineConfiguration
|
||||||
for (LocalDate customHoliday : customHolidays) {
|
for (LocalDate customHoliday : customHolidays) {
|
||||||
if (date.equals(customHoliday)) {
|
if (date.equals(customHoliday)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the date of Easter Sunday for a given year.
|
* Computes the date of Easter Sunday for a given year.
|
||||||
*
|
*
|
||||||
* @param year
|
* @param year
|
||||||
* for which the date of Easter Sunday should be calculated
|
* for which the date of Easter Sunday should be calculated
|
||||||
* @return the date of Easter Sunday for the given year
|
* @return the date of Easter Sunday for the given year
|
||||||
*/
|
*/
|
||||||
public LocalDate getEasterSunday(int year) {
|
public LocalDate getEasterSunday(int year) {
|
||||||
// Formula to compute Easter Sunday by Gauss.
|
// Formula to compute Easter Sunday by Gauss.
|
||||||
int a = year % 19;
|
int a = year % 19;
|
||||||
int b = year % 4;
|
int b = year % 4;
|
||||||
int c = year % 7;
|
int c = year % 7;
|
||||||
int k = year / 100;
|
int k = year / 100;
|
||||||
int p = (13 + 8 * k) / 25;
|
int p = (13 + 8 * k) / 25;
|
||||||
int q = k / 4;
|
int q = k / 4;
|
||||||
int m = (15 - p + k - q) % 30;
|
int m = (15 - p + k - q) % 30;
|
||||||
int n = (4 + k - q) % 7;
|
int n = (4 + k - q) % 7;
|
||||||
int d = (19 * a + m) % 30;
|
int d = (19 * a + m) % 30;
|
||||||
|
|
||||||
int e = (2 * b + 4 * c + 6 * d + n) % 7;
|
int e = (2 * b + 4 * c + 6 * d + n) % 7;
|
||||||
|
|
||||||
if (d == 29 && e == 6) {
|
if (d == 29 && e == 6) {
|
||||||
return LocalDate.of(year, 3, 15).plusDays(d + e);
|
return LocalDate.of(year, 3, 15).plusDays(d + e);
|
||||||
}
|
}
|
||||||
if (d == 28 && e == 6 && (11 * m + 11) % 30 < 19) {
|
if (d == 28 && e == 6 && (11 * m + 11) % 30 < 19) {
|
||||||
return LocalDate.of(year, 3, 15).plusDays(d + e);
|
return LocalDate.of(year, 3, 15).plusDays(d + e);
|
||||||
}
|
}
|
||||||
return LocalDate.of(year, 3, 22).plusDays(d + e);
|
return LocalDate.of(year, 3, 22).plusDays(d + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setCustomHolidays(List<LocalDate> holidays) {
|
public static void setCustomHolidays(List<LocalDate> holidays) {
|
||||||
customHolidays = holidays;
|
customHolidays = holidays;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<LocalDate> getCustomHolidays() {
|
public List<LocalDate> getCustomHolidays() {
|
||||||
return customHolidays;
|
return customHolidays;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setGermanPublicHolidaysEnabled(boolean germanPublicHolidaysEnabled) {
|
public static void setGermanPublicHolidaysEnabled(boolean germanPublicHolidaysEnabled) {
|
||||||
germanHolidaysEnabled = germanPublicHolidaysEnabled;
|
germanHolidaysEnabled = germanPublicHolidaysEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGermanPublicHolidayEnabled() {
|
public boolean isGermanPublicHolidayEnabled() {
|
||||||
return germanHolidaysEnabled;
|
return germanHolidaysEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,52 +1,52 @@
|
||||||
package pro.taskana.impl;
|
package pro.taskana.impl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An item that contains information of a selected item of a Report. It is used to get the task ids of the selected item
|
* An item that contains information of a selected item of a Report. It is used to get the task ids of the selected item
|
||||||
* of the Report.
|
* of the Report.
|
||||||
*/
|
*/
|
||||||
public class SelectedItem {
|
public class SelectedItem {
|
||||||
|
|
||||||
private String key;
|
private String key;
|
||||||
private String subKey;
|
private String subKey;
|
||||||
private int upperAgeLimit;
|
private int upperAgeLimit;
|
||||||
private int lowerAgeLimit;
|
private int lowerAgeLimit;
|
||||||
|
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKey(String key) {
|
public void setKey(String key) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubKey() {
|
public String getSubKey() {
|
||||||
return subKey;
|
return subKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSubKey(String subKey) {
|
public void setSubKey(String subKey) {
|
||||||
this.subKey = subKey;
|
this.subKey = subKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUpperAgeLimit() {
|
public int getUpperAgeLimit() {
|
||||||
return upperAgeLimit;
|
return upperAgeLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpperAgeLimit(int upperAgeLimit) {
|
public void setUpperAgeLimit(int upperAgeLimit) {
|
||||||
this.upperAgeLimit = upperAgeLimit;
|
this.upperAgeLimit = upperAgeLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLowerAgeLimit() {
|
public int getLowerAgeLimit() {
|
||||||
return lowerAgeLimit;
|
return lowerAgeLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLowerAgeLimit(int lowerAgeLimit) {
|
public void setLowerAgeLimit(int lowerAgeLimit) {
|
||||||
this.lowerAgeLimit = lowerAgeLimit;
|
this.lowerAgeLimit = lowerAgeLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Key: " + this.key + ", SubKey: " + this.subKey + ", Limits: (" + this.lowerAgeLimit + ","
|
return "Key: " + this.key + ", SubKey: " + this.subKey + ", Limits: (" + this.lowerAgeLimit + ","
|
||||||
+ this.getUpperAgeLimit() + ")";
|
+ this.getUpperAgeLimit() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,439 +1,439 @@
|
||||||
package pro.taskana.impl;
|
package pro.taskana.impl;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import pro.taskana.CustomField;
|
import pro.taskana.CustomField;
|
||||||
import pro.taskana.TaskMonitorService;
|
import pro.taskana.TaskMonitorService;
|
||||||
import pro.taskana.TaskState;
|
import pro.taskana.TaskState;
|
||||||
import pro.taskana.TaskanaEngine;
|
import pro.taskana.TaskanaEngine;
|
||||||
import pro.taskana.TaskanaRole;
|
import pro.taskana.TaskanaRole;
|
||||||
import pro.taskana.exceptions.InvalidArgumentException;
|
import pro.taskana.exceptions.InvalidArgumentException;
|
||||||
import pro.taskana.exceptions.NotAuthorizedException;
|
import pro.taskana.exceptions.NotAuthorizedException;
|
||||||
import pro.taskana.impl.report.impl.CategoryReport;
|
import pro.taskana.impl.report.impl.CategoryReport;
|
||||||
import pro.taskana.impl.report.impl.ClassificationReport;
|
import pro.taskana.impl.report.impl.ClassificationReport;
|
||||||
import pro.taskana.impl.report.impl.CustomFieldValueReport;
|
import pro.taskana.impl.report.impl.CustomFieldValueReport;
|
||||||
import pro.taskana.impl.report.impl.DaysToWorkingDaysPreProcessor;
|
import pro.taskana.impl.report.impl.DaysToWorkingDaysPreProcessor;
|
||||||
import pro.taskana.impl.report.impl.DetailedClassificationReport;
|
import pro.taskana.impl.report.impl.DetailedClassificationReport;
|
||||||
import pro.taskana.impl.report.impl.DetailedMonitorQueryItem;
|
import pro.taskana.impl.report.impl.DetailedMonitorQueryItem;
|
||||||
import pro.taskana.impl.report.impl.MonitorQueryItem;
|
import pro.taskana.impl.report.impl.MonitorQueryItem;
|
||||||
import pro.taskana.impl.report.impl.TaskQueryItem;
|
import pro.taskana.impl.report.impl.TaskQueryItem;
|
||||||
import pro.taskana.impl.report.impl.TaskStatusReport;
|
import pro.taskana.impl.report.impl.TaskStatusReport;
|
||||||
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
||||||
import pro.taskana.impl.report.impl.WorkbasketLevelReport;
|
import pro.taskana.impl.report.impl.WorkbasketLevelReport;
|
||||||
import pro.taskana.impl.util.LoggerUtils;
|
import pro.taskana.impl.util.LoggerUtils;
|
||||||
import pro.taskana.mappings.TaskMonitorMapper;
|
import pro.taskana.mappings.TaskMonitorMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the implementation of TaskMonitorService.
|
* This is the implementation of TaskMonitorService.
|
||||||
*/
|
*/
|
||||||
public class TaskMonitorServiceImpl implements TaskMonitorService {
|
public class TaskMonitorServiceImpl implements TaskMonitorService {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskMonitorServiceImpl.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(TaskMonitorServiceImpl.class);
|
||||||
private TaskanaEngineImpl taskanaEngineImpl;
|
private TaskanaEngineImpl taskanaEngineImpl;
|
||||||
private TaskMonitorMapper taskMonitorMapper;
|
private TaskMonitorMapper taskMonitorMapper;
|
||||||
|
|
||||||
TaskMonitorServiceImpl(TaskanaEngine taskanaEngine, TaskMonitorMapper taskMonitorMapper) {
|
TaskMonitorServiceImpl(TaskanaEngine taskanaEngine, TaskMonitorMapper taskMonitorMapper) {
|
||||||
super();
|
super();
|
||||||
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||||
this.taskMonitorMapper = taskMonitorMapper;
|
this.taskMonitorMapper = taskMonitorMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states,
|
public WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
|
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getWorkbasketLevelReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
return getWorkbasketLevelReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
||||||
Collections.emptyList(), false);
|
Collections.emptyList(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states,
|
public WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException, NotAuthorizedException {
|
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getWorkbasketLevelReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
return getWorkbasketLevelReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
||||||
columnHeaders, true);
|
columnHeaders, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states,
|
public WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("entry to getWorkbasketLevelReport(workbasketIds = {}, states = {}, categories = {}, "
|
LOGGER.debug("entry to getWorkbasketLevelReport(workbasketIds = {}, states = {}, categories = {}, "
|
||||||
+ "domains = {}, customField = {}, customFieldValues = {}, columnHeaders = {}, "
|
+ "domains = {}, customField = {}, customFieldValues = {}, columnHeaders = {}, "
|
||||||
+ "inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
+ "inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
||||||
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField,
|
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField,
|
||||||
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
||||||
inWorkingDays);
|
inWorkingDays);
|
||||||
}
|
}
|
||||||
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
|
|
||||||
configureDaysToWorkingDaysConverter();
|
configureDaysToWorkingDaysConverter();
|
||||||
|
|
||||||
WorkbasketLevelReport report = new WorkbasketLevelReport(columnHeaders);
|
WorkbasketLevelReport report = new WorkbasketLevelReport(columnHeaders);
|
||||||
List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfWorkbaskets(
|
List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfWorkbaskets(
|
||||||
workbasketIds, states, categories, domains, customField, customFieldValues);
|
workbasketIds, states, categories, domains, customField, customFieldValues);
|
||||||
|
|
||||||
report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
||||||
|
|
||||||
return report;
|
return report;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from getWorkbasketLevelReport().");
|
LOGGER.debug("exit from getWorkbasketLevelReport().");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories,
|
public CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories,
|
||||||
List<String> domains, CustomField customField, List<String> customFieldValues)
|
List<String> domains, CustomField customField, List<String> customFieldValues)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getCategoryReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
return getCategoryReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
||||||
Collections.emptyList(),
|
Collections.emptyList(),
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories,
|
public CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories,
|
||||||
List<String> domains, CustomField customField, List<String> customFieldValues,
|
List<String> domains, CustomField customField, List<String> customFieldValues,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException, NotAuthorizedException {
|
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getCategoryReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
return getCategoryReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
||||||
columnHeaders, true);
|
columnHeaders, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories,
|
public CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories,
|
||||||
List<String> domains, CustomField customField, List<String> customFieldValues,
|
List<String> domains, CustomField customField, List<String> customFieldValues,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("entry to getCategoryReport(workbasketIds = {}, states = {}, categories = {}, "
|
LOGGER.debug("entry to getCategoryReport(workbasketIds = {}, states = {}, categories = {}, "
|
||||||
+ "domains = {}, customField = {}, customFieldValues = {}, reportLineItemDefinitions = {}, "
|
+ "domains = {}, customField = {}, customFieldValues = {}, reportLineItemDefinitions = {}, "
|
||||||
+ "inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
+ "inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
||||||
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField,
|
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField,
|
||||||
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
||||||
inWorkingDays);
|
inWorkingDays);
|
||||||
}
|
}
|
||||||
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
|
|
||||||
configureDaysToWorkingDaysConverter();
|
configureDaysToWorkingDaysConverter();
|
||||||
|
|
||||||
CategoryReport report = new CategoryReport(columnHeaders);
|
CategoryReport report = new CategoryReport(columnHeaders);
|
||||||
List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfCategories(
|
List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfCategories(
|
||||||
workbasketIds, states, categories, domains, customField, customFieldValues);
|
workbasketIds, states, categories, domains, customField, customFieldValues);
|
||||||
|
|
||||||
report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
||||||
|
|
||||||
return report;
|
return report;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from getCategoryReport().");
|
LOGGER.debug("exit from getCategoryReport().");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states,
|
public ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
|
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getClassificationReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
return getClassificationReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
||||||
Collections.emptyList(), false);
|
Collections.emptyList(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states,
|
public ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException, NotAuthorizedException {
|
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getClassificationReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
return getClassificationReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
||||||
columnHeaders, true);
|
columnHeaders, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states,
|
public ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("entry to getClassificationReport(workbasketIds = {}, states = {}, categories = {}, "
|
LOGGER.debug("entry to getClassificationReport(workbasketIds = {}, states = {}, categories = {}, "
|
||||||
+ "domains = {}, customField = {}, customFieldValues = {}, columnHeaders = {}, "
|
+ "domains = {}, customField = {}, customFieldValues = {}, columnHeaders = {}, "
|
||||||
+ "inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
+ "inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
||||||
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField,
|
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField,
|
||||||
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
||||||
inWorkingDays);
|
inWorkingDays);
|
||||||
}
|
}
|
||||||
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
|
|
||||||
configureDaysToWorkingDaysConverter();
|
configureDaysToWorkingDaysConverter();
|
||||||
|
|
||||||
ClassificationReport report = new ClassificationReport(columnHeaders);
|
ClassificationReport report = new ClassificationReport(columnHeaders);
|
||||||
List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfClassifications(
|
List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfClassifications(
|
||||||
workbasketIds, states, categories, domains, customField, customFieldValues);
|
workbasketIds, states, categories, domains, customField, customFieldValues);
|
||||||
|
|
||||||
report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
||||||
|
|
||||||
return report;
|
return report;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from getClassificationReport().");
|
LOGGER.debug("exit from getClassificationReport().");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds,
|
public DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds,
|
||||||
List<TaskState> states, List<String> categories, List<String> domains, CustomField customField,
|
List<TaskState> states, List<String> categories, List<String> domains, CustomField customField,
|
||||||
List<String> customFieldValues) throws InvalidArgumentException, NotAuthorizedException {
|
List<String> customFieldValues) throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getDetailedClassificationReport(workbasketIds, states, categories, domains, customField,
|
return getDetailedClassificationReport(workbasketIds, states, categories, domains, customField,
|
||||||
customFieldValues, Collections.emptyList(), false);
|
customFieldValues, Collections.emptyList(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds,
|
public DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds,
|
||||||
List<TaskState> states, List<String> categories, List<String> domains, CustomField customField,
|
List<TaskState> states, List<String> categories, List<String> domains, CustomField customField,
|
||||||
List<String> customFieldValues, List<TimeIntervalColumnHeader> columnHeaders)
|
List<String> customFieldValues, List<TimeIntervalColumnHeader> columnHeaders)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getDetailedClassificationReport(workbasketIds, states, categories, domains, customField,
|
return getDetailedClassificationReport(workbasketIds, states, categories, domains, customField,
|
||||||
customFieldValues, columnHeaders, true);
|
customFieldValues, columnHeaders, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds,
|
public DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds,
|
||||||
List<TaskState> states, List<String> categories, List<String> domains, CustomField customField,
|
List<TaskState> states, List<String> categories, List<String> domains, CustomField customField,
|
||||||
List<String> customFieldValues, List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
List<String> customFieldValues, List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("entry to getDetailedClassificationReport(workbasketIds = {}, states = {}, "
|
LOGGER.debug("entry to getDetailedClassificationReport(workbasketIds = {}, states = {}, "
|
||||||
+ "categories = {}, domains = {}, customField = {}, customFieldValues = {}, "
|
+ "categories = {}, domains = {}, customField = {}, customFieldValues = {}, "
|
||||||
+ "columnHeaders = {}, inWorkingDays = {})", LoggerUtils.listToString(workbasketIds),
|
+ "columnHeaders = {}, inWorkingDays = {})", LoggerUtils.listToString(workbasketIds),
|
||||||
LoggerUtils.listToString(states), LoggerUtils.listToString(categories),
|
LoggerUtils.listToString(states), LoggerUtils.listToString(categories),
|
||||||
LoggerUtils.listToString(domains), customField, LoggerUtils.listToString(customFieldValues),
|
LoggerUtils.listToString(domains), customField, LoggerUtils.listToString(customFieldValues),
|
||||||
LoggerUtils.listToString(columnHeaders), inWorkingDays);
|
LoggerUtils.listToString(columnHeaders), inWorkingDays);
|
||||||
}
|
}
|
||||||
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
|
|
||||||
configureDaysToWorkingDaysConverter();
|
configureDaysToWorkingDaysConverter();
|
||||||
|
|
||||||
DetailedClassificationReport report = new DetailedClassificationReport(columnHeaders);
|
DetailedClassificationReport report = new DetailedClassificationReport(columnHeaders);
|
||||||
List<DetailedMonitorQueryItem> detailedMonitorQueryItems = taskMonitorMapper
|
List<DetailedMonitorQueryItem> detailedMonitorQueryItems = taskMonitorMapper
|
||||||
.getTaskCountOfDetailedClassifications(workbasketIds, states, categories, domains, customField,
|
.getTaskCountOfDetailedClassifications(workbasketIds, states, categories, domains, customField,
|
||||||
customFieldValues);
|
customFieldValues);
|
||||||
|
|
||||||
report.addItems(detailedMonitorQueryItems,
|
report.addItems(detailedMonitorQueryItems,
|
||||||
new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
||||||
|
|
||||||
return report;
|
return report;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from getDetailedClassificationReport().");
|
LOGGER.debug("exit from getDetailedClassificationReport().");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states,
|
public CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
|
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getCustomFieldValueReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
return getCustomFieldValueReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
||||||
Collections.emptyList(), false);
|
Collections.emptyList(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states,
|
public CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException, NotAuthorizedException {
|
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException, NotAuthorizedException {
|
||||||
return getCustomFieldValueReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
return getCustomFieldValueReport(workbasketIds, states, categories, domains, customField, customFieldValues,
|
||||||
columnHeaders, true);
|
columnHeaders, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states,
|
public CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("entry to getCustomFieldValueReport(workbasketIds = {}, states = {}, categories = {}, "
|
LOGGER.debug("entry to getCustomFieldValueReport(workbasketIds = {}, states = {}, categories = {}, "
|
||||||
+ "domains = {}, customField = {}, customFieldValues = {}, columnHeaders = {}, "
|
+ "domains = {}, customField = {}, customFieldValues = {}, columnHeaders = {}, "
|
||||||
+ "inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
+ "inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
||||||
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField,
|
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField,
|
||||||
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
||||||
inWorkingDays);
|
inWorkingDays);
|
||||||
}
|
}
|
||||||
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
|
|
||||||
if (customField == null) {
|
if (customField == null) {
|
||||||
throw new InvalidArgumentException("CustomField can´t be used as NULL-Parameter");
|
throw new InvalidArgumentException("CustomField can´t be used as NULL-Parameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
configureDaysToWorkingDaysConverter();
|
configureDaysToWorkingDaysConverter();
|
||||||
|
|
||||||
CustomFieldValueReport report = new CustomFieldValueReport(columnHeaders);
|
CustomFieldValueReport report = new CustomFieldValueReport(columnHeaders);
|
||||||
List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfCustomFieldValues(
|
List<MonitorQueryItem> monitorQueryItems = taskMonitorMapper.getTaskCountOfCustomFieldValues(
|
||||||
workbasketIds, states, categories, domains, customField, customFieldValues);
|
workbasketIds, states, categories, domains, customField, customFieldValues);
|
||||||
|
|
||||||
report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
report.addItems(monitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
|
||||||
|
|
||||||
return report;
|
return report;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from getCustomFieldValueReport().");
|
LOGGER.debug("exit from getCustomFieldValueReport().");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getCustomAttributeValuesForReport(List<String> workbasketIds, List<TaskState> states,
|
public List<String> getCustomAttributeValuesForReport(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, List<String> classificationIds,
|
List<String> categories, List<String> domains, List<String> classificationIds,
|
||||||
List<String> excludedClassificationIds, Map<String, String> customAttributeFilter,
|
List<String> excludedClassificationIds, Map<String, String> customAttributeFilter,
|
||||||
String customAttributeName) throws InvalidArgumentException, NotAuthorizedException {
|
String customAttributeName) throws InvalidArgumentException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("entry to getCustomAttributeValuesForReport(workbasketIds = {}, states = {}, "
|
LOGGER.debug("entry to getCustomAttributeValuesForReport(workbasketIds = {}, states = {}, "
|
||||||
+ "categories = {}, domains = {}, classificationIds = {}, excludedClassificationIds = {}, customAttributeName = {})",
|
+ "categories = {}, domains = {}, classificationIds = {}, excludedClassificationIds = {}, customAttributeName = {})",
|
||||||
LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
||||||
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains),
|
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains),
|
||||||
LoggerUtils.listToString(classificationIds), LoggerUtils.listToString(excludedClassificationIds),
|
LoggerUtils.listToString(classificationIds), LoggerUtils.listToString(excludedClassificationIds),
|
||||||
customAttributeName);
|
customAttributeName);
|
||||||
}
|
}
|
||||||
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
|
|
||||||
if (customAttributeName == null || customAttributeName.isEmpty()) {
|
if (customAttributeName == null || customAttributeName.isEmpty()) {
|
||||||
throw new InvalidArgumentException("customAttributeName must not be null.");
|
throw new InvalidArgumentException("customAttributeName must not be null.");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> customAttributeValues = taskMonitorMapper.getCustomAttributeValuesForReport(workbasketIds,
|
List<String> customAttributeValues = taskMonitorMapper.getCustomAttributeValuesForReport(workbasketIds,
|
||||||
states,
|
states,
|
||||||
categories, domains, classificationIds, excludedClassificationIds, customAttributeFilter,
|
categories, domains, classificationIds, excludedClassificationIds, customAttributeFilter,
|
||||||
"CUSTOM_" + customAttributeName);
|
"CUSTOM_" + customAttributeName);
|
||||||
|
|
||||||
return customAttributeValues;
|
return customAttributeValues;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from getCustomAttributeValuesForReport().");
|
LOGGER.debug("exit from getCustomAttributeValuesForReport().");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getTaskIdsForSelectedItems(List<String> workbasketIds, List<TaskState> states,
|
public List<String> getTaskIdsForSelectedItems(List<String> workbasketIds, List<TaskState> states,
|
||||||
List<String> categories, List<String> domains, List<String> classificationIds,
|
List<String> categories, List<String> domains, List<String> classificationIds,
|
||||||
List<String> excludedClassificationIds, CustomField customField, List<String> customFieldValues,
|
List<String> excludedClassificationIds, CustomField customField, List<String> customFieldValues,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays,
|
List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays,
|
||||||
List<SelectedItem> selectedItems, String dimension) throws InvalidArgumentException, NotAuthorizedException {
|
List<SelectedItem> selectedItems, String dimension) throws InvalidArgumentException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("entry to getTaskIdsForSelectedItems(workbasketIds = {}, states = {}, "
|
LOGGER.debug("entry to getTaskIdsForSelectedItems(workbasketIds = {}, states = {}, "
|
||||||
+ "categories = {}, domains = {}, customField = {}, customFieldValues = {}, "
|
+ "categories = {}, domains = {}, customField = {}, customFieldValues = {}, "
|
||||||
+ "columnHeaders = {}, inWorkingDays = {}, selectedItems = {}, dimension = {})",
|
+ "columnHeaders = {}, inWorkingDays = {}, selectedItems = {}, dimension = {})",
|
||||||
LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states),
|
||||||
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains),
|
LoggerUtils.listToString(categories), LoggerUtils.listToString(domains),
|
||||||
LoggerUtils.listToString(classificationIds), LoggerUtils.listToString(excludedClassificationIds),
|
LoggerUtils.listToString(classificationIds), LoggerUtils.listToString(excludedClassificationIds),
|
||||||
customField,
|
customField,
|
||||||
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders),
|
||||||
inWorkingDays, LoggerUtils.listToString(selectedItems), dimension);
|
inWorkingDays, LoggerUtils.listToString(selectedItems), dimension);
|
||||||
}
|
}
|
||||||
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
if (columnHeaders == null) {
|
if (columnHeaders == null) {
|
||||||
throw new InvalidArgumentException("ColumnHeader must not be null.");
|
throw new InvalidArgumentException("ColumnHeader must not be null.");
|
||||||
}
|
}
|
||||||
if (selectedItems == null || selectedItems.size() == 0) {
|
if (selectedItems == null || selectedItems.size() == 0) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
"SelectedItems must not be null or empty.");
|
"SelectedItems must not be null or empty.");
|
||||||
}
|
}
|
||||||
boolean joinWithAttachments = subKeyIsSet(selectedItems);
|
boolean joinWithAttachments = subKeyIsSet(selectedItems);
|
||||||
if (joinWithAttachments && !TaskMonitorService.DIMENSION_CLASSIFICATION_KEY.equals(dimension)) {
|
if (joinWithAttachments && !TaskMonitorService.DIMENSION_CLASSIFICATION_KEY.equals(dimension)) {
|
||||||
throw new InvalidArgumentException("SubKeys are supported for dimension CLASSIFICATION_KEY only.");
|
throw new InvalidArgumentException("SubKeys are supported for dimension CLASSIFICATION_KEY only.");
|
||||||
}
|
}
|
||||||
|
|
||||||
configureDaysToWorkingDaysConverter();
|
configureDaysToWorkingDaysConverter();
|
||||||
|
|
||||||
if (inWorkingDays) {
|
if (inWorkingDays) {
|
||||||
selectedItems = convertWorkingDaysToDays(selectedItems, columnHeaders);
|
selectedItems = convertWorkingDaysToDays(selectedItems, columnHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> taskIds = taskMonitorMapper.getTaskIdsForSelectedItems(workbasketIds, states,
|
List<String> taskIds = taskMonitorMapper.getTaskIdsForSelectedItems(workbasketIds, states,
|
||||||
categories, domains, classificationIds, excludedClassificationIds, customField, customFieldValues,
|
categories, domains, classificationIds, excludedClassificationIds, customField, customFieldValues,
|
||||||
dimension, selectedItems, joinWithAttachments);
|
dimension, selectedItems, joinWithAttachments);
|
||||||
|
|
||||||
return taskIds;
|
return taskIds;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from getTaskIdsForSelectedItems().");
|
LOGGER.debug("exit from getTaskIdsForSelectedItems().");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskStatusReport getTaskStatusReport() throws NotAuthorizedException {
|
public TaskStatusReport getTaskStatusReport() throws NotAuthorizedException {
|
||||||
return getTaskStatusReport(null, null);
|
return getTaskStatusReport(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskStatusReport getTaskStatusReport(List<String> domains) throws NotAuthorizedException {
|
public TaskStatusReport getTaskStatusReport(List<String> domains) throws NotAuthorizedException {
|
||||||
return getTaskStatusReport(domains, null);
|
return getTaskStatusReport(domains, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskStatusReport getTaskStatusReport(List<String> domains, List<TaskState> states)
|
public TaskStatusReport getTaskStatusReport(List<String> domains, List<TaskState> states)
|
||||||
throws NotAuthorizedException {
|
throws NotAuthorizedException {
|
||||||
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
taskanaEngineImpl.checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
|
|
||||||
List<TaskQueryItem> tasks = taskMonitorMapper.getTasksCountByState(domains, states);
|
List<TaskQueryItem> tasks = taskMonitorMapper.getTasksCountByState(domains, states);
|
||||||
TaskStatusReport report = new TaskStatusReport(states);
|
TaskStatusReport report = new TaskStatusReport(states);
|
||||||
report.addItems(tasks);
|
report.addItems(tasks);
|
||||||
return report;
|
return report;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<SelectedItem> convertWorkingDaysToDays(List<SelectedItem> selectedItems,
|
private List<SelectedItem> convertWorkingDaysToDays(List<SelectedItem> selectedItems,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException {
|
List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException {
|
||||||
|
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter.initialize(columnHeaders);
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter.initialize(columnHeaders);
|
||||||
for (SelectedItem selectedItem : selectedItems) {
|
for (SelectedItem selectedItem : selectedItems) {
|
||||||
selectedItem
|
selectedItem
|
||||||
.setLowerAgeLimit(Collections.min(instance.convertWorkingDaysToDays(selectedItem.getLowerAgeLimit())));
|
.setLowerAgeLimit(Collections.min(instance.convertWorkingDaysToDays(selectedItem.getLowerAgeLimit())));
|
||||||
selectedItem
|
selectedItem
|
||||||
.setUpperAgeLimit(Collections.max(instance.convertWorkingDaysToDays(selectedItem.getUpperAgeLimit())));
|
.setUpperAgeLimit(Collections.max(instance.convertWorkingDaysToDays(selectedItem.getUpperAgeLimit())));
|
||||||
}
|
}
|
||||||
return selectedItems;
|
return selectedItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureDaysToWorkingDaysConverter() {
|
private void configureDaysToWorkingDaysConverter() {
|
||||||
DaysToWorkingDaysConverter.setCustomHolidays(taskanaEngineImpl.getConfiguration().getCustomHolidays());
|
DaysToWorkingDaysConverter.setCustomHolidays(taskanaEngineImpl.getConfiguration().getCustomHolidays());
|
||||||
DaysToWorkingDaysConverter.setGermanPublicHolidaysEnabled(
|
DaysToWorkingDaysConverter.setGermanPublicHolidaysEnabled(
|
||||||
this.taskanaEngineImpl.getConfiguration().isGermanPublicHolidaysEnabled());
|
this.taskanaEngineImpl.getConfiguration().isGermanPublicHolidaysEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean subKeyIsSet(List<SelectedItem> selectedItems) {
|
private boolean subKeyIsSet(List<SelectedItem> selectedItems) {
|
||||||
for (SelectedItem selectedItem : selectedItems) {
|
for (SelectedItem selectedItem : selectedItems) {
|
||||||
if (selectedItem.getSubKey() != null && !selectedItem.getSubKey().isEmpty()) {
|
if (selectedItem.getSubKey() != null && !selectedItem.getSubKey().isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,334 +1,334 @@
|
||||||
package pro.taskana.mappings;
|
package pro.taskana.mappings;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Result;
|
import org.apache.ibatis.annotations.Result;
|
||||||
import org.apache.ibatis.annotations.Results;
|
import org.apache.ibatis.annotations.Results;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import pro.taskana.CustomField;
|
import pro.taskana.CustomField;
|
||||||
import pro.taskana.TaskState;
|
import pro.taskana.TaskState;
|
||||||
import pro.taskana.impl.SelectedItem;
|
import pro.taskana.impl.SelectedItem;
|
||||||
import pro.taskana.impl.report.impl.DetailedMonitorQueryItem;
|
import pro.taskana.impl.report.impl.DetailedMonitorQueryItem;
|
||||||
import pro.taskana.impl.report.impl.MonitorQueryItem;
|
import pro.taskana.impl.report.impl.MonitorQueryItem;
|
||||||
import pro.taskana.impl.report.impl.TaskQueryItem;
|
import pro.taskana.impl.report.impl.TaskQueryItem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is the mybatis mapping of task monitoring.
|
* This class is the mybatis mapping of task monitoring.
|
||||||
*/
|
*/
|
||||||
public interface TaskMonitorMapper {
|
public interface TaskMonitorMapper {
|
||||||
|
|
||||||
@Select("<script>"
|
@Select("<script>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">SELECT WORKBASKET_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'db2'\">SELECT WORKBASKET_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">SELECT WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'h2'\">SELECT WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">SELECT WORKBASKET_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">SELECT WORKBASKET_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "FROM TASKANA.TASK "
|
+ "FROM TASKANA.TASK "
|
||||||
+ "<where>"
|
+ "<where>"
|
||||||
+ "<if test=\"workbasketIds != null\">"
|
+ "<if test=\"workbasketIds != null\">"
|
||||||
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"states != null\">"
|
+ "<if test=\"states != null\">"
|
||||||
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"categories != null\">"
|
+ "<if test=\"categories != null\">"
|
||||||
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"domains != null\">"
|
+ "<if test=\"domains != null\">"
|
||||||
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"customField != null and customFieldValues != null\">"
|
+ "<if test=\"customField != null and customFieldValues != null\">"
|
||||||
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "AND DUE IS NOT NULL "
|
+ "AND DUE IS NOT NULL "
|
||||||
+ "</where>"
|
+ "</where>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">GROUP BY WORKBASKET_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
+ "<if test=\"_databaseId == 'db2'\">GROUP BY WORKBASKET_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">GROUP BY WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
+ "<if test=\"_databaseId == 'h2'\">GROUP BY WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY WORKBASKET_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY WORKBASKET_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
||||||
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
@Results({
|
@Results({
|
||||||
@Result(column = "WORKBASKET_KEY", property = "key"),
|
@Result(column = "WORKBASKET_KEY", property = "key"),
|
||||||
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
||||||
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
||||||
List<MonitorQueryItem> getTaskCountOfWorkbaskets(@Param("workbasketIds") List<String> workbasketIds,
|
List<MonitorQueryItem> getTaskCountOfWorkbaskets(@Param("workbasketIds") List<String> workbasketIds,
|
||||||
@Param("states") List<TaskState> states,
|
@Param("states") List<TaskState> states,
|
||||||
@Param("categories") List<String> categories,
|
@Param("categories") List<String> categories,
|
||||||
@Param("domains") List<String> domains,
|
@Param("domains") List<String> domains,
|
||||||
@Param("customField") CustomField customField,
|
@Param("customField") CustomField customField,
|
||||||
@Param("customFieldValues") List<String> customFieldValues);
|
@Param("customFieldValues") List<String> customFieldValues);
|
||||||
|
|
||||||
@Select("<script>"
|
@Select("<script>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">SELECT CLASSIFICATION_CATEGORY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'db2'\">SELECT CLASSIFICATION_CATEGORY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">SELECT CLASSIFICATION_CATEGORY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'h2'\">SELECT CLASSIFICATION_CATEGORY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">SELECT CLASSIFICATION_CATEGORY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">SELECT CLASSIFICATION_CATEGORY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "FROM TASKANA.TASK "
|
+ "FROM TASKANA.TASK "
|
||||||
+ "<where>"
|
+ "<where>"
|
||||||
+ "<if test=\"workbasketIds != null\">"
|
+ "<if test=\"workbasketIds != null\">"
|
||||||
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"states != null\">"
|
+ "<if test=\"states != null\">"
|
||||||
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"categories != null\">"
|
+ "<if test=\"categories != null\">"
|
||||||
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"domains != null\">"
|
+ "<if test=\"domains != null\">"
|
||||||
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"customField != null and customFieldValues != null\">"
|
+ "<if test=\"customField != null and customFieldValues != null\">"
|
||||||
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "AND DUE IS NOT NULL "
|
+ "AND DUE IS NOT NULL "
|
||||||
+ "</where>"
|
+ "</where>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_CATEGORY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_CATEGORY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_CATEGORY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_CATEGORY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY CLASSIFICATION_CATEGORY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY CLASSIFICATION_CATEGORY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
||||||
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
@Results({
|
@Results({
|
||||||
@Result(column = "CLASSIFICATION_CATEGORY", property = "key"),
|
@Result(column = "CLASSIFICATION_CATEGORY", property = "key"),
|
||||||
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
||||||
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
||||||
List<MonitorQueryItem> getTaskCountOfCategories(@Param("workbasketIds") List<String> workbasketIds,
|
List<MonitorQueryItem> getTaskCountOfCategories(@Param("workbasketIds") List<String> workbasketIds,
|
||||||
@Param("states") List<TaskState> states,
|
@Param("states") List<TaskState> states,
|
||||||
@Param("categories") List<String> categories,
|
@Param("categories") List<String> categories,
|
||||||
@Param("domains") List<String> domains,
|
@Param("domains") List<String> domains,
|
||||||
@Param("customField") CustomField customField,
|
@Param("customField") CustomField customField,
|
||||||
@Param("customFieldValues") List<String> customFieldValues);
|
@Param("customFieldValues") List<String> customFieldValues);
|
||||||
|
|
||||||
@Select("<script>"
|
@Select("<script>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">SELECT CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'db2'\">SELECT CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">SELECT CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'h2'\">SELECT CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">SELECT CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">SELECT CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "FROM TASKANA.TASK "
|
+ "FROM TASKANA.TASK "
|
||||||
+ "<where>"
|
+ "<where>"
|
||||||
+ "<if test=\"workbasketIds != null\">"
|
+ "<if test=\"workbasketIds != null\">"
|
||||||
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"states != null\">"
|
+ "<if test=\"states != null\">"
|
||||||
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"categories != null\">"
|
+ "<if test=\"categories != null\">"
|
||||||
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"domains != null\">"
|
+ "<if test=\"domains != null\">"
|
||||||
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"customField != null and customFieldValues != null\">"
|
+ "<if test=\"customField != null and customFieldValues != null\">"
|
||||||
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "AND DUE IS NOT NULL "
|
+ "AND DUE IS NOT NULL "
|
||||||
+ "</where>"
|
+ "</where>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
||||||
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
@Results({
|
@Results({
|
||||||
@Result(column = "CLASSIFICATION_KEY", property = "key"),
|
@Result(column = "CLASSIFICATION_KEY", property = "key"),
|
||||||
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
||||||
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
||||||
List<MonitorQueryItem> getTaskCountOfClassifications(@Param("workbasketIds") List<String> workbasketIds,
|
List<MonitorQueryItem> getTaskCountOfClassifications(@Param("workbasketIds") List<String> workbasketIds,
|
||||||
@Param("states") List<TaskState> states,
|
@Param("states") List<TaskState> states,
|
||||||
@Param("categories") List<String> categories,
|
@Param("categories") List<String> categories,
|
||||||
@Param("domains") List<String> domains,
|
@Param("domains") List<String> domains,
|
||||||
@Param("customField") CustomField customField,
|
@Param("customField") CustomField customField,
|
||||||
@Param("customFieldValues") List<String> customFieldValues);
|
@Param("customFieldValues") List<String> customFieldValues);
|
||||||
|
|
||||||
@Select("<script>"
|
@Select("<script>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'db2'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'h2'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "FROM TASKANA.TASK AS T LEFT JOIN TASKANA.ATTACHMENT AS A ON T.ID = A.TASK_ID "
|
+ "FROM TASKANA.TASK AS T LEFT JOIN TASKANA.ATTACHMENT AS A ON T.ID = A.TASK_ID "
|
||||||
+ "<where>"
|
+ "<where>"
|
||||||
+ "<if test=\"workbasketIds != null\">"
|
+ "<if test=\"workbasketIds != null\">"
|
||||||
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"states != null\">"
|
+ "<if test=\"states != null\">"
|
||||||
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"categories != null\">"
|
+ "<if test=\"categories != null\">"
|
||||||
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"domains != null\">"
|
+ "<if test=\"domains != null\">"
|
||||||
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"customField != null and customFieldValues != null\">"
|
+ "<if test=\"customField != null and customFieldValues != null\">"
|
||||||
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "AND DUE IS NOT NULL "
|
+ "AND DUE IS NOT NULL "
|
||||||
+ "</where>"
|
+ "</where>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
+ "<if test=\"_databaseId == 'db2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
+ "<if test=\"_databaseId == 'h2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
||||||
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
@Results({
|
@Results({
|
||||||
@Result(column = "TASK_CLASSIFICATION_KEY", property = "key"),
|
@Result(column = "TASK_CLASSIFICATION_KEY", property = "key"),
|
||||||
@Result(column = "ATTACHMENT_CLASSIFICATION_KEY", property = "attachmentKey"),
|
@Result(column = "ATTACHMENT_CLASSIFICATION_KEY", property = "attachmentKey"),
|
||||||
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
||||||
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
||||||
List<DetailedMonitorQueryItem> getTaskCountOfDetailedClassifications(
|
List<DetailedMonitorQueryItem> getTaskCountOfDetailedClassifications(
|
||||||
@Param("workbasketIds") List<String> workbasketIds,
|
@Param("workbasketIds") List<String> workbasketIds,
|
||||||
@Param("states") List<TaskState> states,
|
@Param("states") List<TaskState> states,
|
||||||
@Param("categories") List<String> categories,
|
@Param("categories") List<String> categories,
|
||||||
@Param("domains") List<String> domains,
|
@Param("domains") List<String> domains,
|
||||||
@Param("customField") CustomField customField,
|
@Param("customField") CustomField customField,
|
||||||
@Param("customFieldValues") List<String> customFieldValues);
|
@Param("customFieldValues") List<String> customFieldValues);
|
||||||
|
|
||||||
@Select("<script>"
|
@Select("<script>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">SELECT ${customField} as CUSTOM_FIELD, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'db2'\">SELECT ${customField} as CUSTOM_FIELD, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">SELECT ${customField} as CUSTOM_FIELD, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'h2'\">SELECT ${customField} as CUSTOM_FIELD, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">SELECT ${customField} as CUSTOM_FIELD, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">SELECT ${customField} as CUSTOM_FIELD, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
|
||||||
+ "FROM TASKANA.TASK "
|
+ "FROM TASKANA.TASK "
|
||||||
+ "<where>"
|
+ "<where>"
|
||||||
+ "<if test=\"workbasketIds != null\">"
|
+ "<if test=\"workbasketIds != null\">"
|
||||||
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"states != null\">"
|
+ "<if test=\"states != null\">"
|
||||||
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"categories != null\">"
|
+ "<if test=\"categories != null\">"
|
||||||
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"domains != null\">"
|
+ "<if test=\"domains != null\">"
|
||||||
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"customField != null and customFieldValues != null\">"
|
+ "<if test=\"customField != null and customFieldValues != null\">"
|
||||||
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
+ "AND ${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "AND DUE IS NOT NULL "
|
+ "AND DUE IS NOT NULL "
|
||||||
+ "</where>"
|
+ "</where>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">GROUP BY ${customField}, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
+ "<if test=\"_databaseId == 'db2'\">GROUP BY ${customField}, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">GROUP BY ${customField}, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
+ "<if test=\"_databaseId == 'h2'\">GROUP BY ${customField}, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY ${customField}, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY ${customField}, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
|
||||||
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
@Results({
|
@Results({
|
||||||
@Result(column = "CUSTOM_FIELD", property = "key"),
|
@Result(column = "CUSTOM_FIELD", property = "key"),
|
||||||
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
|
||||||
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
|
||||||
List<MonitorQueryItem> getTaskCountOfCustomFieldValues(@Param("workbasketIds") List<String> workbasketIds,
|
List<MonitorQueryItem> getTaskCountOfCustomFieldValues(@Param("workbasketIds") List<String> workbasketIds,
|
||||||
@Param("states") List<TaskState> states,
|
@Param("states") List<TaskState> states,
|
||||||
@Param("categories") List<String> categories,
|
@Param("categories") List<String> categories,
|
||||||
@Param("domains") List<String> domains,
|
@Param("domains") List<String> domains,
|
||||||
@Param("customField") CustomField customField,
|
@Param("customField") CustomField customField,
|
||||||
@Param("customFieldValues") List<String> customFieldValues);
|
@Param("customFieldValues") List<String> customFieldValues);
|
||||||
|
|
||||||
@Select("<script>"
|
@Select("<script>"
|
||||||
+ "SELECT T.ID FROM TASKANA.TASK T "
|
+ "SELECT T.ID FROM TASKANA.TASK T "
|
||||||
+ "<if test=\"joinWithAttachments\">"
|
+ "<if test=\"joinWithAttachments\">"
|
||||||
+ "LEFT JOIN TASKANA.ATTACHMENT A ON T.ID = A.TASK_ID "
|
+ "LEFT JOIN TASKANA.ATTACHMENT A ON T.ID = A.TASK_ID "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<where>"
|
+ "<where>"
|
||||||
+ "<if test=\"workbasketIds != null\">"
|
+ "<if test=\"workbasketIds != null\">"
|
||||||
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"states != null\">"
|
+ "<if test=\"states != null\">"
|
||||||
+ "AND T.STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
+ "AND T.STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"categories != null\">"
|
+ "<if test=\"categories != null\">"
|
||||||
+ "AND T.CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
+ "AND T.CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"domains != null\">"
|
+ "<if test=\"domains != null\">"
|
||||||
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test='classificationIds != null'>"
|
+ "<if test='classificationIds != null'>"
|
||||||
+ "AND T.CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
|
+ "AND T.CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test='excludedClassificationIds != null'>"
|
+ "<if test='excludedClassificationIds != null'>"
|
||||||
+ "AND T.CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
|
+ "AND T.CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"customField != null and customFieldValues != null\">"
|
+ "<if test=\"customField != null and customFieldValues != null\">"
|
||||||
+ "AND T.${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
+ "AND T.${customField} IN (<foreach collection='customFieldValues' item='customFieldValue' separator=','>#{customFieldValue}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "AND T.DUE IS NOT NULL AND ( "
|
+ "AND T.DUE IS NOT NULL AND ( "
|
||||||
+ "<foreach collection='selectedItems' item='selectedItem' separator=' OR '>"
|
+ "<foreach collection='selectedItems' item='selectedItem' separator=' OR '>"
|
||||||
+ "#{selectedItem.key} = T.${groupedBy} AND "
|
+ "#{selectedItem.key} = T.${groupedBy} AND "
|
||||||
+ "<if test=\"joinWithAttachments\">"
|
+ "<if test=\"joinWithAttachments\">"
|
||||||
+ "A.CLASSIFICATION_KEY = #{selectedItem.subKey} AND "
|
+ "A.CLASSIFICATION_KEY = #{selectedItem.subKey} AND "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">"
|
+ "<if test=\"_databaseId == 'db2'\">"
|
||||||
+ "#{selectedItem.upperAgeLimit} >= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) AND "
|
+ "#{selectedItem.upperAgeLimit} >= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) AND "
|
||||||
+ "#{selectedItem.lowerAgeLimit} <= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) "
|
+ "#{selectedItem.lowerAgeLimit} <= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) "
|
||||||
+ "</if> "
|
+ "</if> "
|
||||||
+ "<if test=\"_databaseId == 'h2'\">"
|
+ "<if test=\"_databaseId == 'h2'\">"
|
||||||
+ "#{selectedItem.upperAgeLimit} >= DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) AND "
|
+ "#{selectedItem.upperAgeLimit} >= DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) AND "
|
||||||
+ "#{selectedItem.lowerAgeLimit} <= DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) "
|
+ "#{selectedItem.lowerAgeLimit} <= DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) "
|
||||||
+ "</if> "
|
+ "</if> "
|
||||||
+ "<if test=\"_databaseId == 'postgres'\">"
|
+ "<if test=\"_databaseId == 'postgres'\">"
|
||||||
+ "#{selectedItem.upperAgeLimit} >= DATE_PART('day', DUE - CURRENT_TIMESTAMP ) AND "
|
+ "#{selectedItem.upperAgeLimit} >= DATE_PART('day', DUE - CURRENT_TIMESTAMP ) AND "
|
||||||
+ "#{selectedItem.lowerAgeLimit} <= DATE_PART('day', DUE - CURRENT_TIMESTAMP ) "
|
+ "#{selectedItem.lowerAgeLimit} <= DATE_PART('day', DUE - CURRENT_TIMESTAMP ) "
|
||||||
+ "</if> "
|
+ "</if> "
|
||||||
+ "</foreach>) "
|
+ "</foreach>) "
|
||||||
+ "</where>"
|
+ "</where>"
|
||||||
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
List<String> getTaskIdsForSelectedItems(@Param("workbasketIds") List<String> workbasketIds,
|
List<String> getTaskIdsForSelectedItems(@Param("workbasketIds") List<String> workbasketIds,
|
||||||
@Param("states") List<TaskState> states,
|
@Param("states") List<TaskState> states,
|
||||||
@Param("categories") List<String> categories, @Param("domains") List<String> domains,
|
@Param("categories") List<String> categories, @Param("domains") List<String> domains,
|
||||||
@Param("classificationIds") List<String> classificationIds,
|
@Param("classificationIds") List<String> classificationIds,
|
||||||
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
|
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
|
||||||
@Param("customField") CustomField customField, @Param("customFieldValues") List<String> customFieldValues,
|
@Param("customField") CustomField customField, @Param("customFieldValues") List<String> customFieldValues,
|
||||||
@Param("groupedBy") String groupedBy, @Param("selectedItems") List<SelectedItem> selectedItems,
|
@Param("groupedBy") String groupedBy, @Param("selectedItems") List<SelectedItem> selectedItems,
|
||||||
@Param("joinWithAttachments") boolean joinWithAttachments);
|
@Param("joinWithAttachments") boolean joinWithAttachments);
|
||||||
|
|
||||||
@Select("<script>"
|
@Select("<script>"
|
||||||
+ "SELECT DOMAIN, STATE, COUNT(STATE) as COUNT "
|
+ "SELECT DOMAIN, STATE, COUNT(STATE) as COUNT "
|
||||||
+ "FROM TASKANA.TASK "
|
+ "FROM TASKANA.TASK "
|
||||||
+ "<where>"
|
+ "<where>"
|
||||||
+ "<if test='domains != null'>"
|
+ "<if test='domains != null'>"
|
||||||
+ "DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
+ "DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test='states != null'>"
|
+ "<if test='states != null'>"
|
||||||
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "</where>"
|
+ "</where>"
|
||||||
+ "GROUP BY DOMAIN, STATE"
|
+ "GROUP BY DOMAIN, STATE"
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
@Results({
|
@Results({
|
||||||
@Result(column = "DOMAIN", property = "domain"),
|
@Result(column = "DOMAIN", property = "domain"),
|
||||||
@Result(column = "STATE", property = "state"),
|
@Result(column = "STATE", property = "state"),
|
||||||
@Result(column = "COUNT", property = "count"),
|
@Result(column = "COUNT", property = "count"),
|
||||||
})
|
})
|
||||||
List<TaskQueryItem> getTasksCountByState(@Param("domains") List<String> domains,
|
List<TaskQueryItem> getTasksCountByState(@Param("domains") List<String> domains,
|
||||||
@Param("states") List<TaskState> states);
|
@Param("states") List<TaskState> states);
|
||||||
|
|
||||||
@Select("<script>"
|
@Select("<script>"
|
||||||
+ "SELECT DISTINCT ${customAttributeName} "
|
+ "SELECT DISTINCT ${customAttributeName} "
|
||||||
+ "FROM TASKANA.TASK "
|
+ "FROM TASKANA.TASK "
|
||||||
+ "<where>"
|
+ "<where>"
|
||||||
+ "<if test='workbasketIds != null'>"
|
+ "<if test='workbasketIds != null'>"
|
||||||
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test='states != null'>"
|
+ "<if test='states != null'>"
|
||||||
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test='categories != null'>"
|
+ "<if test='categories != null'>"
|
||||||
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test='domains != null'>"
|
+ "<if test='domains != null'>"
|
||||||
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test='classificationIds != null'>"
|
+ "<if test='classificationIds != null'>"
|
||||||
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
|
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test='excludedClassificationIds != null'>"
|
+ "<if test='excludedClassificationIds != null'>"
|
||||||
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
|
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "<if test='customAttributeFilter != null'>"
|
+ "<if test='customAttributeFilter != null'>"
|
||||||
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(CUSTOM_${key} = '${customAttributeFilter.get(key)}')</foreach>) "
|
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(CUSTOM_${key} = '${customAttributeFilter.get(key)}')</foreach>) "
|
||||||
+ "</if>"
|
+ "</if>"
|
||||||
+ "</where>"
|
+ "</where>"
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
List<String> getCustomAttributeValuesForReport(@Param("workbasketIds") List<String> workbasketIds,
|
List<String> getCustomAttributeValuesForReport(@Param("workbasketIds") List<String> workbasketIds,
|
||||||
@Param("states") List<TaskState> states,
|
@Param("states") List<TaskState> states,
|
||||||
@Param("categories") List<String> categories, @Param("domains") List<String> domains,
|
@Param("categories") List<String> categories, @Param("domains") List<String> domains,
|
||||||
@Param("classificationIds") List<String> classificationIds,
|
@Param("classificationIds") List<String> classificationIds,
|
||||||
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
|
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
|
||||||
@Param("customAttributeFilter") Map<String, String> customAttributeFilter,
|
@Param("customAttributeFilter") Map<String, String> customAttributeFilter,
|
||||||
@Param("customAttributeName") String customAttributeName);
|
@Param("customAttributeName") String customAttributeName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,366 +1,366 @@
|
||||||
package acceptance.monitoring;
|
package acceptance.monitoring;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import pro.taskana.CustomField;
|
import pro.taskana.CustomField;
|
||||||
import pro.taskana.TaskMonitorService;
|
import pro.taskana.TaskMonitorService;
|
||||||
import pro.taskana.TaskState;
|
import pro.taskana.TaskState;
|
||||||
import pro.taskana.TaskanaEngine;
|
import pro.taskana.TaskanaEngine;
|
||||||
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
||||||
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
||||||
import pro.taskana.database.TestDataGenerator;
|
import pro.taskana.database.TestDataGenerator;
|
||||||
import pro.taskana.exceptions.InvalidArgumentException;
|
import pro.taskana.exceptions.InvalidArgumentException;
|
||||||
import pro.taskana.exceptions.NotAuthorizedException;
|
import pro.taskana.exceptions.NotAuthorizedException;
|
||||||
import pro.taskana.impl.SelectedItem;
|
import pro.taskana.impl.SelectedItem;
|
||||||
import pro.taskana.impl.TaskanaEngineImpl;
|
import pro.taskana.impl.TaskanaEngineImpl;
|
||||||
import pro.taskana.impl.configuration.DBCleaner;
|
import pro.taskana.impl.configuration.DBCleaner;
|
||||||
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
||||||
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
||||||
import pro.taskana.security.JAASRunner;
|
import pro.taskana.security.JAASRunner;
|
||||||
import pro.taskana.security.WithAccessId;
|
import pro.taskana.security.WithAccessId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acceptance test for all "get task ids of category report" scenarios.
|
* Acceptance test for all "get task ids of category report" scenarios.
|
||||||
*/
|
*/
|
||||||
@RunWith(JAASRunner.class)
|
@RunWith(JAASRunner.class)
|
||||||
public class GetTaskIdsOfCategoryReportAccTest {
|
public class GetTaskIdsOfCategoryReportAccTest {
|
||||||
|
|
||||||
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
||||||
protected static TaskanaEngine taskanaEngine;
|
protected static TaskanaEngine taskanaEngine;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupTest() throws Exception {
|
public static void setupTest() throws Exception {
|
||||||
resetDb();
|
resetDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void resetDb() throws SQLException, IOException {
|
public static void resetDb() throws SQLException, IOException {
|
||||||
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
DBCleaner cleaner = new DBCleaner();
|
DBCleaner cleaner = new DBCleaner();
|
||||||
cleaner.clearDb(dataSource, true);
|
cleaner.clearDb(dataSource, true);
|
||||||
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
||||||
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
||||||
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
((TaskanaEngineImpl) taskanaEngine).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
((TaskanaEngineImpl) taskanaEngine).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
||||||
cleaner.clearDb(dataSource, false);
|
cleaner.clearDb(dataSource, false);
|
||||||
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
||||||
testDataGenerator.generateMonitoringTestData(dataSource);
|
testDataGenerator.generateMonitoringTestData(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = NotAuthorizedException.class)
|
@Test(expected = NotAuthorizedException.class)
|
||||||
public void testRoleCheck() throws InvalidArgumentException, NotAuthorizedException {
|
public void testRoleCheck() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
List<SelectedItem> selectedItems = new ArrayList<>();
|
List<SelectedItem> selectedItems = new ArrayList<>();
|
||||||
taskMonitorService.getTaskIdsForSelectedItems(null, null, null, null, null,
|
taskMonitorService.getTaskIdsForSelectedItems(null, null, null, null, null,
|
||||||
null, null, null,
|
null, null, null,
|
||||||
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTaskIdsOfCategoryReport() throws InvalidArgumentException, NotAuthorizedException {
|
public void testGetTaskIdsOfCategoryReport() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
List<SelectedItem> selectedItems = new ArrayList<>();
|
List<SelectedItem> selectedItems = new ArrayList<>();
|
||||||
|
|
||||||
SelectedItem s1 = new SelectedItem();
|
SelectedItem s1 = new SelectedItem();
|
||||||
s1.setKey("EXTERN");
|
s1.setKey("EXTERN");
|
||||||
s1.setLowerAgeLimit(-5);
|
s1.setLowerAgeLimit(-5);
|
||||||
s1.setUpperAgeLimit(-2);
|
s1.setUpperAgeLimit(-2);
|
||||||
selectedItems.add(s1);
|
selectedItems.add(s1);
|
||||||
|
|
||||||
SelectedItem s2 = new SelectedItem();
|
SelectedItem s2 = new SelectedItem();
|
||||||
s2.setKey("AUTOMATIC");
|
s2.setKey("AUTOMATIC");
|
||||||
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
||||||
s2.setUpperAgeLimit(-11);
|
s2.setUpperAgeLimit(-11);
|
||||||
selectedItems.add(s2);
|
selectedItems.add(s2);
|
||||||
|
|
||||||
SelectedItem s3 = new SelectedItem();
|
SelectedItem s3 = new SelectedItem();
|
||||||
s3.setKey("MANUAL");
|
s3.setKey("MANUAL");
|
||||||
s3.setLowerAgeLimit(0);
|
s3.setLowerAgeLimit(0);
|
||||||
s3.setUpperAgeLimit(0);
|
s3.setUpperAgeLimit(0);
|
||||||
selectedItems.add(s3);
|
selectedItems.add(s3);
|
||||||
|
|
||||||
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, null, null, null, null,
|
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, null, null, null, null,
|
||||||
null, null, null,
|
null, null, null,
|
||||||
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
||||||
|
|
||||||
assertEquals(11, ids.size());
|
assertEquals(11, ids.size());
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000021"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000021"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000022"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000022"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000023"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000023"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000026"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000026"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000028"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000028"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTaskIdsOfCategoryReportWithWorkbasketFilter()
|
public void testGetTaskIdsOfCategoryReportWithWorkbasketFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
List<SelectedItem> selectedItems = new ArrayList<>();
|
List<SelectedItem> selectedItems = new ArrayList<>();
|
||||||
|
|
||||||
SelectedItem s1 = new SelectedItem();
|
SelectedItem s1 = new SelectedItem();
|
||||||
s1.setKey("EXTERN");
|
s1.setKey("EXTERN");
|
||||||
s1.setLowerAgeLimit(-5);
|
s1.setLowerAgeLimit(-5);
|
||||||
s1.setUpperAgeLimit(-2);
|
s1.setUpperAgeLimit(-2);
|
||||||
selectedItems.add(s1);
|
selectedItems.add(s1);
|
||||||
|
|
||||||
SelectedItem s2 = new SelectedItem();
|
SelectedItem s2 = new SelectedItem();
|
||||||
s2.setKey("AUTOMATIC");
|
s2.setKey("AUTOMATIC");
|
||||||
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
||||||
s2.setUpperAgeLimit(-11);
|
s2.setUpperAgeLimit(-11);
|
||||||
selectedItems.add(s2);
|
selectedItems.add(s2);
|
||||||
|
|
||||||
SelectedItem s3 = new SelectedItem();
|
SelectedItem s3 = new SelectedItem();
|
||||||
s3.setKey("MANUAL");
|
s3.setKey("MANUAL");
|
||||||
s3.setLowerAgeLimit(0);
|
s3.setLowerAgeLimit(0);
|
||||||
s3.setUpperAgeLimit(0);
|
s3.setUpperAgeLimit(0);
|
||||||
selectedItems.add(s3);
|
selectedItems.add(s3);
|
||||||
|
|
||||||
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(workbasketIds, null, null, null, null,
|
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(workbasketIds, null, null, null, null,
|
||||||
null, null, null,
|
null, null, null,
|
||||||
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
||||||
|
|
||||||
assertEquals(4, ids.size());
|
assertEquals(4, ids.size());
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000026"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000026"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTaskIdsOfCategoryReportWithStateFilter()
|
public void testGetTaskIdsOfCategoryReportWithStateFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
List<SelectedItem> selectedItems = new ArrayList<>();
|
List<SelectedItem> selectedItems = new ArrayList<>();
|
||||||
|
|
||||||
SelectedItem s1 = new SelectedItem();
|
SelectedItem s1 = new SelectedItem();
|
||||||
s1.setKey("EXTERN");
|
s1.setKey("EXTERN");
|
||||||
s1.setLowerAgeLimit(-5);
|
s1.setLowerAgeLimit(-5);
|
||||||
s1.setUpperAgeLimit(-2);
|
s1.setUpperAgeLimit(-2);
|
||||||
selectedItems.add(s1);
|
selectedItems.add(s1);
|
||||||
|
|
||||||
SelectedItem s2 = new SelectedItem();
|
SelectedItem s2 = new SelectedItem();
|
||||||
s2.setKey("AUTOMATIC");
|
s2.setKey("AUTOMATIC");
|
||||||
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
||||||
s2.setUpperAgeLimit(-11);
|
s2.setUpperAgeLimit(-11);
|
||||||
selectedItems.add(s2);
|
selectedItems.add(s2);
|
||||||
|
|
||||||
SelectedItem s3 = new SelectedItem();
|
SelectedItem s3 = new SelectedItem();
|
||||||
s3.setKey("MANUAL");
|
s3.setKey("MANUAL");
|
||||||
s3.setLowerAgeLimit(0);
|
s3.setLowerAgeLimit(0);
|
||||||
s3.setUpperAgeLimit(0);
|
s3.setUpperAgeLimit(0);
|
||||||
selectedItems.add(s3);
|
selectedItems.add(s3);
|
||||||
|
|
||||||
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, states, null, null, null,
|
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, states, null, null, null,
|
||||||
null, null, null,
|
null, null, null,
|
||||||
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
||||||
|
|
||||||
assertEquals(11, ids.size());
|
assertEquals(11, ids.size());
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000021"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000021"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000022"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000022"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000023"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000023"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000026"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000026"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000028"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000028"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTaskIdsOfCategoryReportWithCategoryFilter()
|
public void testGetTaskIdsOfCategoryReportWithCategoryFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
List<SelectedItem> selectedItems = new ArrayList<>();
|
List<SelectedItem> selectedItems = new ArrayList<>();
|
||||||
|
|
||||||
SelectedItem s1 = new SelectedItem();
|
SelectedItem s1 = new SelectedItem();
|
||||||
s1.setKey("AUTOMATIC");
|
s1.setKey("AUTOMATIC");
|
||||||
s1.setLowerAgeLimit(Integer.MIN_VALUE);
|
s1.setLowerAgeLimit(Integer.MIN_VALUE);
|
||||||
s1.setUpperAgeLimit(-11);
|
s1.setUpperAgeLimit(-11);
|
||||||
selectedItems.add(s1);
|
selectedItems.add(s1);
|
||||||
|
|
||||||
SelectedItem s2 = new SelectedItem();
|
SelectedItem s2 = new SelectedItem();
|
||||||
s2.setKey("MANUAL");
|
s2.setKey("MANUAL");
|
||||||
s2.setLowerAgeLimit(0);
|
s2.setLowerAgeLimit(0);
|
||||||
s2.setUpperAgeLimit(0);
|
s2.setUpperAgeLimit(0);
|
||||||
selectedItems.add(s2);
|
selectedItems.add(s2);
|
||||||
|
|
||||||
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, null, categories, null, null,
|
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, null, categories, null, null,
|
||||||
null, null, null,
|
null, null, null,
|
||||||
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
||||||
|
|
||||||
assertEquals(3, ids.size());
|
assertEquals(3, ids.size());
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTaskIdsOfCategoryReportWithDomainFilter()
|
public void testGetTaskIdsOfCategoryReportWithDomainFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> domains = Collections.singletonList("DOMAIN_A");
|
List<String> domains = Collections.singletonList("DOMAIN_A");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
List<SelectedItem> selectedItems = new ArrayList<>();
|
List<SelectedItem> selectedItems = new ArrayList<>();
|
||||||
|
|
||||||
SelectedItem s1 = new SelectedItem();
|
SelectedItem s1 = new SelectedItem();
|
||||||
s1.setKey("EXTERN");
|
s1.setKey("EXTERN");
|
||||||
s1.setLowerAgeLimit(-5);
|
s1.setLowerAgeLimit(-5);
|
||||||
s1.setUpperAgeLimit(-2);
|
s1.setUpperAgeLimit(-2);
|
||||||
selectedItems.add(s1);
|
selectedItems.add(s1);
|
||||||
|
|
||||||
SelectedItem s2 = new SelectedItem();
|
SelectedItem s2 = new SelectedItem();
|
||||||
s2.setKey("AUTOMATIC");
|
s2.setKey("AUTOMATIC");
|
||||||
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
||||||
s2.setUpperAgeLimit(-11);
|
s2.setUpperAgeLimit(-11);
|
||||||
selectedItems.add(s2);
|
selectedItems.add(s2);
|
||||||
|
|
||||||
SelectedItem s3 = new SelectedItem();
|
SelectedItem s3 = new SelectedItem();
|
||||||
s3.setKey("MANUAL");
|
s3.setKey("MANUAL");
|
||||||
s3.setLowerAgeLimit(0);
|
s3.setLowerAgeLimit(0);
|
||||||
s3.setUpperAgeLimit(0);
|
s3.setUpperAgeLimit(0);
|
||||||
selectedItems.add(s3);
|
selectedItems.add(s3);
|
||||||
|
|
||||||
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, null, null, domains, null,
|
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, null, null, domains, null,
|
||||||
null, null, null,
|
null, null, null,
|
||||||
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
||||||
|
|
||||||
assertEquals(4, ids.size());
|
assertEquals(4, ids.size());
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000021"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000021"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000022"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000022"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000028"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000028"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTaskIdsOfCategoryReportWithCustomFieldValueFilter()
|
public void testGetTaskIdsOfCategoryReportWithCustomFieldValueFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
List<SelectedItem> selectedItems = new ArrayList<>();
|
List<SelectedItem> selectedItems = new ArrayList<>();
|
||||||
|
|
||||||
SelectedItem s1 = new SelectedItem();
|
SelectedItem s1 = new SelectedItem();
|
||||||
s1.setKey("EXTERN");
|
s1.setKey("EXTERN");
|
||||||
s1.setLowerAgeLimit(-5);
|
s1.setLowerAgeLimit(-5);
|
||||||
s1.setUpperAgeLimit(-2);
|
s1.setUpperAgeLimit(-2);
|
||||||
selectedItems.add(s1);
|
selectedItems.add(s1);
|
||||||
|
|
||||||
SelectedItem s2 = new SelectedItem();
|
SelectedItem s2 = new SelectedItem();
|
||||||
s2.setKey("AUTOMATIC");
|
s2.setKey("AUTOMATIC");
|
||||||
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
s2.setLowerAgeLimit(Integer.MIN_VALUE);
|
||||||
s2.setUpperAgeLimit(-11);
|
s2.setUpperAgeLimit(-11);
|
||||||
selectedItems.add(s2);
|
selectedItems.add(s2);
|
||||||
|
|
||||||
SelectedItem s3 = new SelectedItem();
|
SelectedItem s3 = new SelectedItem();
|
||||||
s3.setKey("MANUAL");
|
s3.setKey("MANUAL");
|
||||||
s3.setLowerAgeLimit(0);
|
s3.setLowerAgeLimit(0);
|
||||||
s3.setUpperAgeLimit(0);
|
s3.setUpperAgeLimit(0);
|
||||||
selectedItems.add(s3);
|
selectedItems.add(s3);
|
||||||
|
|
||||||
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, null, null, null, null, null,
|
List<String> ids = taskMonitorService.getTaskIdsForSelectedItems(null, null, null, null, null, null,
|
||||||
customField,
|
customField,
|
||||||
customFieldValues,
|
customFieldValues,
|
||||||
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
||||||
|
|
||||||
assertEquals(5, ids.size());
|
assertEquals(5, ids.size());
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
|
||||||
assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
|
assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test(expected = InvalidArgumentException.class)
|
@Test(expected = InvalidArgumentException.class)
|
||||||
public void testThrowsExceptionIfSubKeysAreUsed() throws InvalidArgumentException, NotAuthorizedException {
|
public void testThrowsExceptionIfSubKeysAreUsed() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
List<SelectedItem> selectedItems = new ArrayList<>();
|
List<SelectedItem> selectedItems = new ArrayList<>();
|
||||||
|
|
||||||
SelectedItem s1 = new SelectedItem();
|
SelectedItem s1 = new SelectedItem();
|
||||||
s1.setKey("EXTERN");
|
s1.setKey("EXTERN");
|
||||||
s1.setSubKey("INVALID");
|
s1.setSubKey("INVALID");
|
||||||
s1.setLowerAgeLimit(-5);
|
s1.setLowerAgeLimit(-5);
|
||||||
s1.setUpperAgeLimit(-2);
|
s1.setUpperAgeLimit(-2);
|
||||||
selectedItems.add(s1);
|
selectedItems.add(s1);
|
||||||
|
|
||||||
taskMonitorService.getTaskIdsForSelectedItems(null, null, null, null, null,
|
taskMonitorService.getTaskIdsForSelectedItems(null, null, null, null, null,
|
||||||
null, null, null,
|
null, null, null,
|
||||||
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
columnHeaders, true, selectedItems, TaskMonitorService.DIMENSION_CLASSIFICATION_CATEGORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,428 +1,428 @@
|
||||||
package acceptance.monitoring;
|
package acceptance.monitoring;
|
||||||
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import pro.taskana.CustomField;
|
import pro.taskana.CustomField;
|
||||||
import pro.taskana.TaskMonitorService;
|
import pro.taskana.TaskMonitorService;
|
||||||
import pro.taskana.TaskState;
|
import pro.taskana.TaskState;
|
||||||
import pro.taskana.TaskanaEngine;
|
import pro.taskana.TaskanaEngine;
|
||||||
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
||||||
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
||||||
import pro.taskana.database.TestDataGenerator;
|
import pro.taskana.database.TestDataGenerator;
|
||||||
import pro.taskana.exceptions.InvalidArgumentException;
|
import pro.taskana.exceptions.InvalidArgumentException;
|
||||||
import pro.taskana.exceptions.NotAuthorizedException;
|
import pro.taskana.exceptions.NotAuthorizedException;
|
||||||
import pro.taskana.impl.TaskanaEngineImpl;
|
import pro.taskana.impl.TaskanaEngineImpl;
|
||||||
import pro.taskana.impl.configuration.DBCleaner;
|
import pro.taskana.impl.configuration.DBCleaner;
|
||||||
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
||||||
import pro.taskana.impl.report.impl.CategoryReport;
|
import pro.taskana.impl.report.impl.CategoryReport;
|
||||||
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
||||||
import pro.taskana.security.JAASRunner;
|
import pro.taskana.security.JAASRunner;
|
||||||
import pro.taskana.security.WithAccessId;
|
import pro.taskana.security.WithAccessId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acceptance test for all "category report" scenarios.
|
* Acceptance test for all "category report" scenarios.
|
||||||
*/
|
*/
|
||||||
@RunWith(JAASRunner.class)
|
@RunWith(JAASRunner.class)
|
||||||
public class ProvideCategoryReportAccTest {
|
public class ProvideCategoryReportAccTest {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ProvideCategoryReportAccTest.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(ProvideCategoryReportAccTest.class);
|
||||||
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
||||||
protected static TaskanaEngine taskanaEngine;
|
protected static TaskanaEngine taskanaEngine;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupTest() throws Exception {
|
public static void setupTest() throws Exception {
|
||||||
resetDb();
|
resetDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void resetDb() throws SQLException, IOException {
|
public static void resetDb() throws SQLException, IOException {
|
||||||
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
DBCleaner cleaner = new DBCleaner();
|
DBCleaner cleaner = new DBCleaner();
|
||||||
cleaner.clearDb(dataSource, true);
|
cleaner.clearDb(dataSource, true);
|
||||||
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
||||||
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
||||||
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
((TaskanaEngineImpl) taskanaEngine).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
((TaskanaEngineImpl) taskanaEngine).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
||||||
cleaner.clearDb(dataSource, false);
|
cleaner.clearDb(dataSource, false);
|
||||||
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
||||||
testDataGenerator.generateMonitoringTestData(dataSource);
|
testDataGenerator.generateMonitoringTestData(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = NotAuthorizedException.class)
|
@Test(expected = NotAuthorizedException.class)
|
||||||
public void testRoleCheck() throws InvalidArgumentException, NotAuthorizedException {
|
public void testRoleCheck() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
taskMonitorService.getCategoryReport(null, null, null, null, null, null);
|
taskMonitorService.getCategoryReport(null, null, null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTotalNumbersOfTasksOfCategoryReport() throws InvalidArgumentException, NotAuthorizedException {
|
public void testGetTotalNumbersOfTasksOfCategoryReport() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null);
|
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report));
|
LOGGER.debug(reportToString(report));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
assertEquals(33, report.getRow("EXTERN").getTotalValue());
|
assertEquals(33, report.getRow("EXTERN").getTotalValue());
|
||||||
assertEquals(7, report.getRow("AUTOMATIC").getTotalValue());
|
assertEquals(7, report.getRow("AUTOMATIC").getTotalValue());
|
||||||
assertEquals(10, report.getRow("MANUAL").getTotalValue());
|
assertEquals(10, report.getRow("MANUAL").getTotalValue());
|
||||||
assertEquals(0, report.getRow("EXTERN").getCells().length);
|
assertEquals(0, report.getRow("EXTERN").getCells().length);
|
||||||
assertEquals(0, report.getRow("AUTOMATIC").getCells().length);
|
assertEquals(0, report.getRow("AUTOMATIC").getCells().length);
|
||||||
assertEquals(0, report.getRow("MANUAL").getCells().length);
|
assertEquals(0, report.getRow("MANUAL").getCells().length);
|
||||||
assertEquals(50, report.getSumRow().getTotalValue());
|
assertEquals(50, report.getSumRow().getTotalValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetCategoryReportWithReportLineItemDefinitions()
|
public void testGetCategoryReportWithReportLineItemDefinitions()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null,
|
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
int sumLineCount = IntStream.of(report.getSumRow().getCells()).sum();
|
int sumLineCount = IntStream.of(report.getSumRow().getCells()).sum();
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
assertEquals(33, report.getRow("EXTERN").getTotalValue());
|
assertEquals(33, report.getRow("EXTERN").getTotalValue());
|
||||||
assertEquals(7, report.getRow("AUTOMATIC").getTotalValue());
|
assertEquals(7, report.getRow("AUTOMATIC").getTotalValue());
|
||||||
assertEquals(10, report.getRow("MANUAL").getTotalValue());
|
assertEquals(10, report.getRow("MANUAL").getTotalValue());
|
||||||
|
|
||||||
int[] sumRow = report.getSumRow().getCells();
|
int[] sumRow = report.getSumRow().getCells();
|
||||||
assertArrayEquals(new int[] {10, 9, 11, 0, 4, 0, 7, 4, 5}, sumRow);
|
assertArrayEquals(new int[] {10, 9, 11, 0, 4, 0, 7, 4, 5}, sumRow);
|
||||||
assertEquals(50, report.getSumRow().getTotalValue());
|
assertEquals(50, report.getSumRow().getTotalValue());
|
||||||
assertEquals(50, sumLineCount);
|
assertEquals(50, sumLineCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCategoryReport() throws InvalidArgumentException, NotAuthorizedException {
|
public void testEachItemOfCategoryReport() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null,
|
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("EXTERN").getCells();
|
int[] row1 = report.getRow("EXTERN").getCells();
|
||||||
assertArrayEquals(new int[] {15, 8, 2, 6, 2}, row1);
|
assertArrayEquals(new int[] {15, 8, 2, 6, 2}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 0, 1, 3}, row2);
|
assertArrayEquals(new int[] {2, 1, 0, 1, 3}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("MANUAL").getCells();
|
int[] row3 = report.getRow("MANUAL").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 2, 0, 4}, row3);
|
assertArrayEquals(new int[] {2, 2, 2, 0, 4}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCategoryReportNotInWorkingDays() throws InvalidArgumentException, NotAuthorizedException {
|
public void testEachItemOfCategoryReportNotInWorkingDays() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null,
|
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null,
|
||||||
columnHeaders, false);
|
columnHeaders, false);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("EXTERN").getCells();
|
int[] row1 = report.getRow("EXTERN").getCells();
|
||||||
assertArrayEquals(new int[] {23, 0, 2, 0, 8}, row1);
|
assertArrayEquals(new int[] {23, 0, 2, 0, 8}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
||||||
assertArrayEquals(new int[] {3, 0, 0, 0, 4}, row2);
|
assertArrayEquals(new int[] {3, 0, 0, 0, 4}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("MANUAL").getCells();
|
int[] row3 = report.getRow("MANUAL").getCells();
|
||||||
assertArrayEquals(new int[] {4, 0, 2, 0, 4}, row3);
|
assertArrayEquals(new int[] {4, 0, 2, 0, 4}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCategoryReportWithWorkbasketFilter()
|
public void testEachItemOfCategoryReportWithWorkbasketFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CategoryReport report = taskMonitorService.getCategoryReport(workbasketIds, null, null, null, null, null,
|
CategoryReport report = taskMonitorService.getCategoryReport(workbasketIds, null, null, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("EXTERN").getCells();
|
int[] row1 = report.getRow("EXTERN").getCells();
|
||||||
assertArrayEquals(new int[] {10, 2, 0, 0, 0}, row1);
|
assertArrayEquals(new int[] {10, 2, 0, 0, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 0, 1, 1}, row2);
|
assertArrayEquals(new int[] {2, 1, 0, 1, 1}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("MANUAL").getCells();
|
int[] row3 = report.getRow("MANUAL").getCells();
|
||||||
assertArrayEquals(new int[] {1, 0, 1, 0, 1}, row3);
|
assertArrayEquals(new int[] {1, 0, 1, 0, 1}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCategoryReportWithStateFilter() throws InvalidArgumentException, NotAuthorizedException {
|
public void testEachItemOfCategoryReportWithStateFilter() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CategoryReport report = taskMonitorService.getCategoryReport(null, states, null, null, null, null,
|
CategoryReport report = taskMonitorService.getCategoryReport(null, states, null, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("EXTERN").getCells();
|
int[] row1 = report.getRow("EXTERN").getCells();
|
||||||
assertArrayEquals(new int[] {15, 8, 2, 6, 0}, row1);
|
assertArrayEquals(new int[] {15, 8, 2, 6, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 0, 1, 0}, row2);
|
assertArrayEquals(new int[] {2, 1, 0, 1, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("MANUAL").getCells();
|
int[] row3 = report.getRow("MANUAL").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 2, 0, 0}, row3);
|
assertArrayEquals(new int[] {2, 2, 2, 0, 0}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCategoryReportWithCategoryFilter()
|
public void testEachItemOfCategoryReportWithCategoryFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CategoryReport report = taskMonitorService.getCategoryReport(null, null, categories, null, null, null,
|
CategoryReport report = taskMonitorService.getCategoryReport(null, null, categories, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(2, report.rowSize());
|
assertEquals(2, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("AUTOMATIC").getCells();
|
int[] row1 = report.getRow("AUTOMATIC").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 0, 1, 3}, row1);
|
assertArrayEquals(new int[] {2, 1, 0, 1, 3}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("MANUAL").getCells();
|
int[] row2 = report.getRow("MANUAL").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 2, 0, 4}, row2);
|
assertArrayEquals(new int[] {2, 2, 2, 0, 4}, row2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCategoryReportWithDomainFilter() throws InvalidArgumentException, NotAuthorizedException {
|
public void testEachItemOfCategoryReportWithDomainFilter() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> domains = Collections.singletonList("DOMAIN_A");
|
List<String> domains = Collections.singletonList("DOMAIN_A");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, domains, null, null,
|
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, domains, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("EXTERN").getCells();
|
int[] row1 = report.getRow("EXTERN").getCells();
|
||||||
assertArrayEquals(new int[] {8, 4, 2, 4, 0}, row1);
|
assertArrayEquals(new int[] {8, 4, 2, 4, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
||||||
assertArrayEquals(new int[] {1, 0, 0, 1, 1}, row2);
|
assertArrayEquals(new int[] {1, 0, 0, 1, 1}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("MANUAL").getCells();
|
int[] row3 = report.getRow("MANUAL").getCells();
|
||||||
assertArrayEquals(new int[] {2, 0, 0, 0, 3}, row3);
|
assertArrayEquals(new int[] {2, 0, 0, 0, 3}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCategoryReportWithCustomFieldValueFilter()
|
public void testEachItemOfCategoryReportWithCustomFieldValueFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, customField,
|
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, customField,
|
||||||
customFieldValues, columnHeaders);
|
customFieldValues, columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("EXTERN").getCells();
|
int[] row1 = report.getRow("EXTERN").getCells();
|
||||||
assertArrayEquals(new int[] {9, 3, 1, 3, 0}, row1);
|
assertArrayEquals(new int[] {9, 3, 1, 3, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
int[] row2 = report.getRow("AUTOMATIC").getCells();
|
||||||
assertArrayEquals(new int[] {1, 0, 0, 1, 1}, row2);
|
assertArrayEquals(new int[] {1, 0, 0, 1, 1}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("MANUAL").getCells();
|
int[] row3 = report.getRow("MANUAL").getCells();
|
||||||
assertArrayEquals(new int[] {1, 1, 2, 0, 2}, row3);
|
assertArrayEquals(new int[] {1, 1, 2, 0, 2}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -6));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -6));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-5, -1));
|
columnHeaders.add(new TimeIntervalColumnHeader(-5, -1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1, 5));
|
columnHeaders.add(new TimeIntervalColumnHeader(1, 5));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(6, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(6, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String reportToString(CategoryReport report) {
|
private String reportToString(CategoryReport report) {
|
||||||
return reportToString(report, null);
|
return reportToString(report, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String reportToString(CategoryReport report,
|
private String reportToString(CategoryReport report,
|
||||||
List<TimeIntervalColumnHeader> columnHeaders) {
|
List<TimeIntervalColumnHeader> columnHeaders) {
|
||||||
String formatColumWidth = "| %-7s ";
|
String formatColumWidth = "| %-7s ";
|
||||||
String formatFirstColumn = "| %-36s %-4s ";
|
String formatFirstColumn = "| %-36s %-4s ";
|
||||||
String formatFirstColumnFirstLine = "| %-29s %12s ";
|
String formatFirstColumnFirstLine = "| %-29s %12s ";
|
||||||
String formatFirstColumnSumLine = "| %-36s %-5s";
|
String formatFirstColumnSumLine = "| %-36s %-5s";
|
||||||
int reportWidth = columnHeaders == null ? 46 : columnHeaders.size() * 10 + 46;
|
int reportWidth = columnHeaders == null ? 46 : columnHeaders.size() * 10 + 46;
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
builder.append(String.format(formatFirstColumnFirstLine, "Categories", "Total"));
|
builder.append(String.format(formatFirstColumnFirstLine, "Categories", "Total"));
|
||||||
if (columnHeaders != null) {
|
if (columnHeaders != null) {
|
||||||
for (TimeIntervalColumnHeader def : columnHeaders) {
|
for (TimeIntervalColumnHeader def : columnHeaders) {
|
||||||
if (def.getLowerAgeLimit() == Integer.MIN_VALUE) {
|
if (def.getLowerAgeLimit() == Integer.MIN_VALUE) {
|
||||||
builder.append(String.format(formatColumWidth, "< " + def.getUpperAgeLimit()));
|
builder.append(String.format(formatColumWidth, "< " + def.getUpperAgeLimit()));
|
||||||
} else if (def.getUpperAgeLimit() == Integer.MAX_VALUE) {
|
} else if (def.getUpperAgeLimit() == Integer.MAX_VALUE) {
|
||||||
builder.append(String.format(formatColumWidth, "> " + def.getLowerAgeLimit()));
|
builder.append(String.format(formatColumWidth, "> " + def.getLowerAgeLimit()));
|
||||||
} else if (def.getLowerAgeLimit() == def.getUpperAgeLimit()) {
|
} else if (def.getLowerAgeLimit() == def.getUpperAgeLimit()) {
|
||||||
if (def.getLowerAgeLimit() == 0) {
|
if (def.getLowerAgeLimit() == 0) {
|
||||||
builder.append(String.format(formatColumWidth, "today"));
|
builder.append(String.format(formatColumWidth, "today"));
|
||||||
} else {
|
} else {
|
||||||
builder.append(String.format(formatColumWidth, def.getLowerAgeLimit()));
|
builder.append(String.format(formatColumWidth, def.getLowerAgeLimit()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
builder.append(
|
builder.append(
|
||||||
String.format(formatColumWidth, def.getLowerAgeLimit() + ".." + def.getUpperAgeLimit()));
|
String.format(formatColumWidth, def.getLowerAgeLimit() + ".." + def.getUpperAgeLimit()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
|
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
|
|
||||||
for (String rl : report.rowTitles()) {
|
for (String rl : report.rowTitles()) {
|
||||||
builder
|
builder
|
||||||
.append(String.format(formatFirstColumn, rl, report.getRow(rl).getTotalValue()));
|
.append(String.format(formatFirstColumn, rl, report.getRow(rl).getTotalValue()));
|
||||||
if (columnHeaders != null) {
|
if (columnHeaders != null) {
|
||||||
for (int cell : report.getRow(rl).getCells()) {
|
for (int cell : report.getRow(rl).getCells()) {
|
||||||
builder.append(String.format(formatColumWidth, cell));
|
builder.append(String.format(formatColumWidth, cell));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
}
|
}
|
||||||
builder.append(String.format(formatFirstColumnSumLine, "Total", report.getSumRow().getTotalValue()));
|
builder.append(String.format(formatFirstColumnSumLine, "Total", report.getSumRow().getTotalValue()));
|
||||||
for (int cell : report.getSumRow().getCells()) {
|
for (int cell : report.getSumRow().getCells()) {
|
||||||
builder.append(String.format(formatColumWidth, cell));
|
builder.append(String.format(formatColumWidth, cell));
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,482 +1,482 @@
|
||||||
package acceptance.monitoring;
|
package acceptance.monitoring;
|
||||||
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import pro.taskana.CustomField;
|
import pro.taskana.CustomField;
|
||||||
import pro.taskana.TaskMonitorService;
|
import pro.taskana.TaskMonitorService;
|
||||||
import pro.taskana.TaskState;
|
import pro.taskana.TaskState;
|
||||||
import pro.taskana.TaskanaEngine;
|
import pro.taskana.TaskanaEngine;
|
||||||
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
||||||
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
||||||
import pro.taskana.database.TestDataGenerator;
|
import pro.taskana.database.TestDataGenerator;
|
||||||
import pro.taskana.exceptions.InvalidArgumentException;
|
import pro.taskana.exceptions.InvalidArgumentException;
|
||||||
import pro.taskana.exceptions.NotAuthorizedException;
|
import pro.taskana.exceptions.NotAuthorizedException;
|
||||||
import pro.taskana.impl.TaskanaEngineImpl;
|
import pro.taskana.impl.TaskanaEngineImpl;
|
||||||
import pro.taskana.impl.configuration.DBCleaner;
|
import pro.taskana.impl.configuration.DBCleaner;
|
||||||
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
||||||
import pro.taskana.impl.report.impl.ClassificationReport;
|
import pro.taskana.impl.report.impl.ClassificationReport;
|
||||||
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
||||||
import pro.taskana.security.JAASRunner;
|
import pro.taskana.security.JAASRunner;
|
||||||
import pro.taskana.security.WithAccessId;
|
import pro.taskana.security.WithAccessId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acceptance test for all "classification report" scenarios.
|
* Acceptance test for all "classification report" scenarios.
|
||||||
*/
|
*/
|
||||||
@RunWith(JAASRunner.class)
|
@RunWith(JAASRunner.class)
|
||||||
public class ProvideClassificationReportAccTest {
|
public class ProvideClassificationReportAccTest {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ProvideClassificationReportAccTest.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(ProvideClassificationReportAccTest.class);
|
||||||
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
||||||
protected static TaskanaEngine taskanaEngine;
|
protected static TaskanaEngine taskanaEngine;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupTest() throws Exception {
|
public static void setupTest() throws Exception {
|
||||||
resetDb();
|
resetDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void resetDb() throws SQLException, IOException {
|
public static void resetDb() throws SQLException, IOException {
|
||||||
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
DBCleaner cleaner = new DBCleaner();
|
DBCleaner cleaner = new DBCleaner();
|
||||||
cleaner.clearDb(dataSource, true);
|
cleaner.clearDb(dataSource, true);
|
||||||
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
||||||
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
||||||
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
((TaskanaEngineImpl) taskanaEngine).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
((TaskanaEngineImpl) taskanaEngine).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
||||||
cleaner.clearDb(dataSource, false);
|
cleaner.clearDb(dataSource, false);
|
||||||
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
||||||
testDataGenerator.generateMonitoringTestData(dataSource);
|
testDataGenerator.generateMonitoringTestData(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = NotAuthorizedException.class)
|
@Test(expected = NotAuthorizedException.class)
|
||||||
public void testRoleCheck()
|
public void testRoleCheck()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
taskMonitorService.getClassificationReport(null, null, null, null, null, null);
|
taskMonitorService.getClassificationReport(null, null, null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTotalNumbersOfTasksOfClassificationReport()
|
public void testGetTotalNumbersOfTasksOfClassificationReport()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null);
|
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report));
|
LOGGER.debug(reportToString(report));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(5, report.rowSize());
|
assertEquals(5, report.rowSize());
|
||||||
|
|
||||||
assertEquals(10, report.getRow("L10000").getTotalValue());
|
assertEquals(10, report.getRow("L10000").getTotalValue());
|
||||||
assertEquals(10, report.getRow("L20000").getTotalValue());
|
assertEquals(10, report.getRow("L20000").getTotalValue());
|
||||||
assertEquals(7, report.getRow("L30000").getTotalValue());
|
assertEquals(7, report.getRow("L30000").getTotalValue());
|
||||||
assertEquals(10, report.getRow("L40000").getTotalValue());
|
assertEquals(10, report.getRow("L40000").getTotalValue());
|
||||||
assertEquals(13, report.getRow("L50000").getTotalValue());
|
assertEquals(13, report.getRow("L50000").getTotalValue());
|
||||||
assertEquals(0, report.getRow("L10000").getCells().length);
|
assertEquals(0, report.getRow("L10000").getCells().length);
|
||||||
assertEquals(0, report.getRow("L20000").getCells().length);
|
assertEquals(0, report.getRow("L20000").getCells().length);
|
||||||
assertEquals(0, report.getRow("L30000").getCells().length);
|
assertEquals(0, report.getRow("L30000").getCells().length);
|
||||||
assertEquals(0, report.getRow("L40000").getCells().length);
|
assertEquals(0, report.getRow("L40000").getCells().length);
|
||||||
assertEquals(0, report.getRow("L50000").getCells().length);
|
assertEquals(0, report.getRow("L50000").getCells().length);
|
||||||
assertEquals(50, report.getSumRow().getTotalValue());
|
assertEquals(50, report.getSumRow().getTotalValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetClassificationReportWithReportLineItemDefinitions()
|
public void testGetClassificationReportWithReportLineItemDefinitions()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> reportLineItemDefinitions = getListOfColumnsHeaders();
|
List<TimeIntervalColumnHeader> reportLineItemDefinitions = getListOfColumnsHeaders();
|
||||||
|
|
||||||
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null,
|
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null,
|
||||||
reportLineItemDefinitions);
|
reportLineItemDefinitions);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, reportLineItemDefinitions));
|
LOGGER.debug(reportToString(report, reportLineItemDefinitions));
|
||||||
}
|
}
|
||||||
|
|
||||||
int sumLineCount = IntStream.of(report.getSumRow().getCells()).sum();
|
int sumLineCount = IntStream.of(report.getSumRow().getCells()).sum();
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(5, report.rowSize());
|
assertEquals(5, report.rowSize());
|
||||||
|
|
||||||
assertEquals(10, report.getRow("L10000").getTotalValue());
|
assertEquals(10, report.getRow("L10000").getTotalValue());
|
||||||
assertEquals(10, report.getRow("L20000").getTotalValue());
|
assertEquals(10, report.getRow("L20000").getTotalValue());
|
||||||
assertEquals(7, report.getRow("L30000").getTotalValue());
|
assertEquals(7, report.getRow("L30000").getTotalValue());
|
||||||
assertEquals(10, report.getRow("L40000").getTotalValue());
|
assertEquals(10, report.getRow("L40000").getTotalValue());
|
||||||
assertEquals(13, report.getRow("L50000").getTotalValue());
|
assertEquals(13, report.getRow("L50000").getTotalValue());
|
||||||
|
|
||||||
assertEquals(10, report.getSumRow().getCells()[0]);
|
assertEquals(10, report.getSumRow().getCells()[0]);
|
||||||
assertEquals(9, report.getSumRow().getCells()[1]);
|
assertEquals(9, report.getSumRow().getCells()[1]);
|
||||||
assertEquals(11, report.getSumRow().getCells()[2]);
|
assertEquals(11, report.getSumRow().getCells()[2]);
|
||||||
assertEquals(0, report.getSumRow().getCells()[3]);
|
assertEquals(0, report.getSumRow().getCells()[3]);
|
||||||
assertEquals(4, report.getSumRow().getCells()[4]);
|
assertEquals(4, report.getSumRow().getCells()[4]);
|
||||||
assertEquals(0, report.getSumRow().getCells()[5]);
|
assertEquals(0, report.getSumRow().getCells()[5]);
|
||||||
assertEquals(7, report.getSumRow().getCells()[6]);
|
assertEquals(7, report.getSumRow().getCells()[6]);
|
||||||
assertEquals(4, report.getSumRow().getCells()[7]);
|
assertEquals(4, report.getSumRow().getCells()[7]);
|
||||||
assertEquals(5, report.getSumRow().getCells()[8]);
|
assertEquals(5, report.getSumRow().getCells()[8]);
|
||||||
assertEquals(50, report.getSumRow().getTotalValue());
|
assertEquals(50, report.getSumRow().getTotalValue());
|
||||||
assertEquals(50, sumLineCount);
|
assertEquals(50, sumLineCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfClassificationReport() throws InvalidArgumentException, NotAuthorizedException {
|
public void testEachItemOfClassificationReport() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null,
|
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(5, report.rowSize());
|
assertEquals(5, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("L10000").getCells();
|
int[] row1 = report.getRow("L10000").getCells();
|
||||||
assertArrayEquals(new int[] {7, 2, 1, 0, 0}, row1);
|
assertArrayEquals(new int[] {7, 2, 1, 0, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("L20000").getCells();
|
int[] row2 = report.getRow("L20000").getCells();
|
||||||
assertArrayEquals(new int[] {5, 3, 1, 1, 0}, row2);
|
assertArrayEquals(new int[] {5, 3, 1, 1, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("L30000").getCells();
|
int[] row3 = report.getRow("L30000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 0, 1, 3}, row3);
|
assertArrayEquals(new int[] {2, 1, 0, 1, 3}, row3);
|
||||||
|
|
||||||
int[] row4 = report.getRow("L40000").getCells();
|
int[] row4 = report.getRow("L40000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 2, 0, 4}, row4);
|
assertArrayEquals(new int[] {2, 2, 2, 0, 4}, row4);
|
||||||
|
|
||||||
int[] row5 = report.getRow("L50000").getCells();
|
int[] row5 = report.getRow("L50000").getCells();
|
||||||
assertArrayEquals(new int[] {3, 3, 0, 5, 2}, row5);
|
assertArrayEquals(new int[] {3, 3, 0, 5, 2}, row5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfClassificationReportNotInWorkingDays()
|
public void testEachItemOfClassificationReportNotInWorkingDays()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> reportLineItemDefinitions = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> reportLineItemDefinitions = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null,
|
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null,
|
||||||
reportLineItemDefinitions, false);
|
reportLineItemDefinitions, false);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, reportLineItemDefinitions));
|
LOGGER.debug(reportToString(report, reportLineItemDefinitions));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(5, report.rowSize());
|
assertEquals(5, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("L10000").getCells();
|
int[] row1 = report.getRow("L10000").getCells();
|
||||||
assertArrayEquals(new int[] {9, 0, 1, 0, 0}, row1);
|
assertArrayEquals(new int[] {9, 0, 1, 0, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("L20000").getCells();
|
int[] row2 = report.getRow("L20000").getCells();
|
||||||
assertArrayEquals(new int[] {8, 0, 1, 0, 1}, row2);
|
assertArrayEquals(new int[] {8, 0, 1, 0, 1}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("L30000").getCells();
|
int[] row3 = report.getRow("L30000").getCells();
|
||||||
assertArrayEquals(new int[] {3, 0, 0, 0, 4}, row3);
|
assertArrayEquals(new int[] {3, 0, 0, 0, 4}, row3);
|
||||||
|
|
||||||
int[] row4 = report.getRow("L40000").getCells();
|
int[] row4 = report.getRow("L40000").getCells();
|
||||||
assertArrayEquals(new int[] {4, 0, 2, 0, 4}, row4);
|
assertArrayEquals(new int[] {4, 0, 2, 0, 4}, row4);
|
||||||
|
|
||||||
int[] row5 = report.getRow("L50000").getCells();
|
int[] row5 = report.getRow("L50000").getCells();
|
||||||
assertArrayEquals(new int[] {6, 0, 0, 0, 7}, row5);
|
assertArrayEquals(new int[] {6, 0, 0, 0, 7}, row5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfClassificationReportWithWorkbasketFilter()
|
public void testEachItemOfClassificationReportWithWorkbasketFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
ClassificationReport report = taskMonitorService.getClassificationReport(workbasketIds, null, null, null, null,
|
ClassificationReport report = taskMonitorService.getClassificationReport(workbasketIds, null, null, null, null,
|
||||||
null,
|
null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(5, report.rowSize());
|
assertEquals(5, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("L10000").getCells();
|
int[] row1 = report.getRow("L10000").getCells();
|
||||||
assertArrayEquals(new int[] {6, 0, 0, 0, 0}, row1);
|
assertArrayEquals(new int[] {6, 0, 0, 0, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("L20000").getCells();
|
int[] row2 = report.getRow("L20000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 0, 0, 0, 0}, row2);
|
assertArrayEquals(new int[] {2, 0, 0, 0, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("L30000").getCells();
|
int[] row3 = report.getRow("L30000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 0, 1, 1}, row3);
|
assertArrayEquals(new int[] {2, 1, 0, 1, 1}, row3);
|
||||||
|
|
||||||
int[] row4 = report.getRow("L40000").getCells();
|
int[] row4 = report.getRow("L40000").getCells();
|
||||||
assertArrayEquals(new int[] {1, 0, 1, 0, 1}, row4);
|
assertArrayEquals(new int[] {1, 0, 1, 0, 1}, row4);
|
||||||
|
|
||||||
int[] row5 = report.getRow("L50000").getCells();
|
int[] row5 = report.getRow("L50000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 0, 0, 0}, row5);
|
assertArrayEquals(new int[] {2, 2, 0, 0, 0}, row5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfClassificationReportWithStateFilter()
|
public void testEachItemOfClassificationReportWithStateFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
ClassificationReport report = taskMonitorService.getClassificationReport(null, states, null, null, null, null,
|
ClassificationReport report = taskMonitorService.getClassificationReport(null, states, null, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(5, report.rowSize());
|
assertEquals(5, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("L10000").getCells();
|
int[] row1 = report.getRow("L10000").getCells();
|
||||||
assertArrayEquals(new int[] {7, 2, 1, 0, 0}, row1);
|
assertArrayEquals(new int[] {7, 2, 1, 0, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("L20000").getCells();
|
int[] row2 = report.getRow("L20000").getCells();
|
||||||
assertArrayEquals(new int[] {5, 3, 1, 1, 0}, row2);
|
assertArrayEquals(new int[] {5, 3, 1, 1, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("L30000").getCells();
|
int[] row3 = report.getRow("L30000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 0, 1, 0}, row3);
|
assertArrayEquals(new int[] {2, 1, 0, 1, 0}, row3);
|
||||||
|
|
||||||
int[] row4 = report.getRow("L40000").getCells();
|
int[] row4 = report.getRow("L40000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 2, 0, 0}, row4);
|
assertArrayEquals(new int[] {2, 2, 2, 0, 0}, row4);
|
||||||
|
|
||||||
int[] row5 = report.getRow("L50000").getCells();
|
int[] row5 = report.getRow("L50000").getCells();
|
||||||
assertArrayEquals(new int[] {3, 3, 0, 5, 0}, row5);
|
assertArrayEquals(new int[] {3, 3, 0, 5, 0}, row5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfClassificationReportWithCategoryFilter()
|
public void testEachItemOfClassificationReportWithCategoryFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, categories, null, null,
|
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, categories, null, null,
|
||||||
null, columnHeaders);
|
null, columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(2, report.rowSize());
|
assertEquals(2, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("L30000").getCells();
|
int[] row1 = report.getRow("L30000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 0, 1, 3}, row1);
|
assertArrayEquals(new int[] {2, 1, 0, 1, 3}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("L40000").getCells();
|
int[] row2 = report.getRow("L40000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 2, 0, 4}, row2);
|
assertArrayEquals(new int[] {2, 2, 2, 0, 4}, row2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfClassificationReportWithDomainFilter()
|
public void testEachItemOfClassificationReportWithDomainFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> domains = Collections.singletonList("DOMAIN_A");
|
List<String> domains = Collections.singletonList("DOMAIN_A");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, domains, null, null,
|
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, domains, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(5, report.rowSize());
|
assertEquals(5, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("L10000").getCells();
|
int[] row1 = report.getRow("L10000").getCells();
|
||||||
assertArrayEquals(new int[] {5, 2, 1, 0, 0}, row1);
|
assertArrayEquals(new int[] {5, 2, 1, 0, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("L20000").getCells();
|
int[] row2 = report.getRow("L20000").getCells();
|
||||||
assertArrayEquals(new int[] {3, 1, 1, 1, 0}, row2);
|
assertArrayEquals(new int[] {3, 1, 1, 1, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("L30000").getCells();
|
int[] row3 = report.getRow("L30000").getCells();
|
||||||
assertArrayEquals(new int[] {1, 0, 0, 1, 1}, row3);
|
assertArrayEquals(new int[] {1, 0, 0, 1, 1}, row3);
|
||||||
|
|
||||||
int[] row4 = report.getRow("L40000").getCells();
|
int[] row4 = report.getRow("L40000").getCells();
|
||||||
assertArrayEquals(new int[] {2, 0, 0, 0, 3}, row4);
|
assertArrayEquals(new int[] {2, 0, 0, 0, 3}, row4);
|
||||||
|
|
||||||
int[] row5 = report.getRow("L50000").getCells();
|
int[] row5 = report.getRow("L50000").getCells();
|
||||||
assertArrayEquals(new int[] {0, 1, 0, 3, 0}, row5);
|
assertArrayEquals(new int[] {0, 1, 0, 3, 0}, row5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfClassificationReportWithCustomFieldValueFilter()
|
public void testEachItemOfClassificationReportWithCustomFieldValueFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, customField,
|
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, customField,
|
||||||
customFieldValues, columnHeaders);
|
customFieldValues, columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(5, report.rowSize());
|
assertEquals(5, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("L10000").getCells();
|
int[] row1 = report.getRow("L10000").getCells();
|
||||||
assertArrayEquals(new int[] {4, 0, 0, 0, 0}, row1);
|
assertArrayEquals(new int[] {4, 0, 0, 0, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("L20000").getCells();
|
int[] row2 = report.getRow("L20000").getCells();
|
||||||
assertArrayEquals(new int[] {4, 1, 1, 1, 0}, row2);
|
assertArrayEquals(new int[] {4, 1, 1, 1, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("L30000").getCells();
|
int[] row3 = report.getRow("L30000").getCells();
|
||||||
assertArrayEquals(new int[] {1, 0, 0, 1, 1}, row3);
|
assertArrayEquals(new int[] {1, 0, 0, 1, 1}, row3);
|
||||||
|
|
||||||
int[] row4 = report.getRow("L40000").getCells();
|
int[] row4 = report.getRow("L40000").getCells();
|
||||||
assertArrayEquals(new int[] {1, 1, 2, 0, 2}, row4);
|
assertArrayEquals(new int[] {1, 1, 2, 0, 2}, row4);
|
||||||
|
|
||||||
int[] row5 = report.getRow("L50000").getCells();
|
int[] row5 = report.getRow("L50000").getCells();
|
||||||
assertArrayEquals(new int[] {1, 2, 0, 2, 0}, row5);
|
assertArrayEquals(new int[] {1, 2, 0, 2, 0}, row5);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getListOfColumnsHeaders() {
|
private List<TimeIntervalColumnHeader> getListOfColumnsHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> reportLineItemDefinitions = new ArrayList<>();
|
List<TimeIntervalColumnHeader> reportLineItemDefinitions = new ArrayList<>();
|
||||||
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -6));
|
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -6));
|
||||||
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(-5, -1));
|
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(-5, -1));
|
||||||
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(0));
|
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(0));
|
||||||
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(1, 5));
|
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(1, 5));
|
||||||
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(6, Integer.MAX_VALUE));
|
reportLineItemDefinitions.add(new TimeIntervalColumnHeader(6, Integer.MAX_VALUE));
|
||||||
return reportLineItemDefinitions;
|
return reportLineItemDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String reportToString(ClassificationReport report) {
|
private String reportToString(ClassificationReport report) {
|
||||||
return reportToString(report, null);
|
return reportToString(report, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String reportToString(ClassificationReport report, List<TimeIntervalColumnHeader> columnHeaders) {
|
private String reportToString(ClassificationReport report, List<TimeIntervalColumnHeader> columnHeaders) {
|
||||||
String formatColumWidth = "| %-7s ";
|
String formatColumWidth = "| %-7s ";
|
||||||
String formatFirstColumn = "| %-36s %-4s ";
|
String formatFirstColumn = "| %-36s %-4s ";
|
||||||
String formatFirstColumnFirstLine = "| %-29s %12s ";
|
String formatFirstColumnFirstLine = "| %-29s %12s ";
|
||||||
String formatFirstColumnSumLine = "| %-36s %-5s";
|
String formatFirstColumnSumLine = "| %-36s %-5s";
|
||||||
int reportWidth = columnHeaders == null ? 46 : columnHeaders.size() * 10 + 46;
|
int reportWidth = columnHeaders == null ? 46 : columnHeaders.size() * 10 + 46;
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
builder.append(String.format(formatFirstColumnFirstLine, "Classifications", "Total"));
|
builder.append(String.format(formatFirstColumnFirstLine, "Classifications", "Total"));
|
||||||
if (columnHeaders != null) {
|
if (columnHeaders != null) {
|
||||||
for (TimeIntervalColumnHeader def : columnHeaders) {
|
for (TimeIntervalColumnHeader def : columnHeaders) {
|
||||||
if (def.getLowerAgeLimit() == Integer.MIN_VALUE) {
|
if (def.getLowerAgeLimit() == Integer.MIN_VALUE) {
|
||||||
builder.append(String.format(formatColumWidth, "< " + def.getUpperAgeLimit()));
|
builder.append(String.format(formatColumWidth, "< " + def.getUpperAgeLimit()));
|
||||||
} else if (def.getUpperAgeLimit() == Integer.MAX_VALUE) {
|
} else if (def.getUpperAgeLimit() == Integer.MAX_VALUE) {
|
||||||
builder.append(String.format(formatColumWidth, "> " + def.getLowerAgeLimit()));
|
builder.append(String.format(formatColumWidth, "> " + def.getLowerAgeLimit()));
|
||||||
} else if (def.getLowerAgeLimit() == def.getUpperAgeLimit()) {
|
} else if (def.getLowerAgeLimit() == def.getUpperAgeLimit()) {
|
||||||
if (def.getLowerAgeLimit() == 0) {
|
if (def.getLowerAgeLimit() == 0) {
|
||||||
builder.append(String.format(formatColumWidth, "today"));
|
builder.append(String.format(formatColumWidth, "today"));
|
||||||
} else {
|
} else {
|
||||||
builder.append(String.format(formatColumWidth, def.getLowerAgeLimit()));
|
builder.append(String.format(formatColumWidth, def.getLowerAgeLimit()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
builder.append(
|
builder.append(
|
||||||
String.format(formatColumWidth, def.getLowerAgeLimit() + ".." + def.getUpperAgeLimit()));
|
String.format(formatColumWidth, def.getLowerAgeLimit() + ".." + def.getUpperAgeLimit()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
|
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
|
|
||||||
for (String rl : report.rowTitles()) {
|
for (String rl : report.rowTitles()) {
|
||||||
builder
|
builder
|
||||||
.append(String.format(formatFirstColumn, rl, report.getRow(rl).getTotalValue()));
|
.append(String.format(formatFirstColumn, rl, report.getRow(rl).getTotalValue()));
|
||||||
if (columnHeaders != null) {
|
if (columnHeaders != null) {
|
||||||
for (int cell : report.getRow(rl).getCells()) {
|
for (int cell : report.getRow(rl).getCells()) {
|
||||||
builder.append(String.format(formatColumWidth, cell));
|
builder.append(String.format(formatColumWidth, cell));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
}
|
}
|
||||||
builder.append(String.format(formatFirstColumnSumLine, "Total", report.getSumRow().getTotalValue()));
|
builder.append(String.format(formatFirstColumnSumLine, "Total", report.getSumRow().getTotalValue()));
|
||||||
for (int cell : report.getSumRow().getCells()) {
|
for (int cell : report.getSumRow().getCells()) {
|
||||||
builder.append(String.format(formatColumWidth, cell));
|
builder.append(String.format(formatColumWidth, cell));
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,474 +1,474 @@
|
||||||
package acceptance.monitoring;
|
package acceptance.monitoring;
|
||||||
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import pro.taskana.CustomField;
|
import pro.taskana.CustomField;
|
||||||
import pro.taskana.TaskMonitorService;
|
import pro.taskana.TaskMonitorService;
|
||||||
import pro.taskana.TaskState;
|
import pro.taskana.TaskState;
|
||||||
import pro.taskana.TaskanaEngine;
|
import pro.taskana.TaskanaEngine;
|
||||||
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
||||||
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
||||||
import pro.taskana.database.TestDataGenerator;
|
import pro.taskana.database.TestDataGenerator;
|
||||||
import pro.taskana.exceptions.InvalidArgumentException;
|
import pro.taskana.exceptions.InvalidArgumentException;
|
||||||
import pro.taskana.exceptions.NotAuthorizedException;
|
import pro.taskana.exceptions.NotAuthorizedException;
|
||||||
import pro.taskana.impl.configuration.DBCleaner;
|
import pro.taskana.impl.configuration.DBCleaner;
|
||||||
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
||||||
import pro.taskana.impl.report.impl.CustomFieldValueReport;
|
import pro.taskana.impl.report.impl.CustomFieldValueReport;
|
||||||
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
||||||
import pro.taskana.security.JAASRunner;
|
import pro.taskana.security.JAASRunner;
|
||||||
import pro.taskana.security.WithAccessId;
|
import pro.taskana.security.WithAccessId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acceptance test for all "classification report" scenarios.
|
* Acceptance test for all "classification report" scenarios.
|
||||||
*/
|
*/
|
||||||
@RunWith(JAASRunner.class)
|
@RunWith(JAASRunner.class)
|
||||||
public class ProvideCustomFieldValueReportAccTest {
|
public class ProvideCustomFieldValueReportAccTest {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ProvideCustomFieldValueReportAccTest.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(ProvideCustomFieldValueReportAccTest.class);
|
||||||
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
||||||
protected static TaskanaEngine taskanaEngine;
|
protected static TaskanaEngine taskanaEngine;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupTest() throws Exception {
|
public static void setupTest() throws Exception {
|
||||||
resetDb();
|
resetDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void resetDb() throws SQLException, IOException {
|
public static void resetDb() throws SQLException, IOException {
|
||||||
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
DBCleaner cleaner = new DBCleaner();
|
DBCleaner cleaner = new DBCleaner();
|
||||||
cleaner.clearDb(dataSource, true);
|
cleaner.clearDb(dataSource, true);
|
||||||
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
||||||
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
||||||
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
taskanaEngine.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
taskanaEngine.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
||||||
cleaner.clearDb(dataSource, false);
|
cleaner.clearDb(dataSource, false);
|
||||||
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
||||||
testDataGenerator.generateMonitoringTestData(dataSource);
|
testDataGenerator.generateMonitoringTestData(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = NotAuthorizedException.class)
|
@Test(expected = NotAuthorizedException.class)
|
||||||
public void testRoleCheck()
|
public void testRoleCheck()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
|
|
||||||
taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
||||||
customField, null);
|
customField, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom1()
|
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom1()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
||||||
customField, null);
|
customField, null);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report));
|
LOGGER.debug(reportToString(report));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
assertEquals(25, report.getRow("Geschaeftsstelle A").getTotalValue());
|
assertEquals(25, report.getRow("Geschaeftsstelle A").getTotalValue());
|
||||||
assertEquals(10, report.getRow("Geschaeftsstelle B").getTotalValue());
|
assertEquals(10, report.getRow("Geschaeftsstelle B").getTotalValue());
|
||||||
assertEquals(15, report.getRow("Geschaeftsstelle C").getTotalValue());
|
assertEquals(15, report.getRow("Geschaeftsstelle C").getTotalValue());
|
||||||
assertEquals(0, report.getRow("Geschaeftsstelle A").getCells().length);
|
assertEquals(0, report.getRow("Geschaeftsstelle A").getCells().length);
|
||||||
assertEquals(0, report.getRow("Geschaeftsstelle B").getCells().length);
|
assertEquals(0, report.getRow("Geschaeftsstelle B").getCells().length);
|
||||||
assertEquals(0, report.getRow("Geschaeftsstelle C").getCells().length);
|
assertEquals(0, report.getRow("Geschaeftsstelle C").getCells().length);
|
||||||
|
|
||||||
assertEquals(50, report.getSumRow().getTotalValue());
|
assertEquals(50, report.getSumRow().getTotalValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom2()
|
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom2()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_2;
|
CustomField customField = CustomField.CUSTOM_2;
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
||||||
customField, null);
|
customField, null);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report));
|
LOGGER.debug(reportToString(report));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(2, report.rowSize());
|
assertEquals(2, report.rowSize());
|
||||||
|
|
||||||
assertEquals(21, report.getRow("Vollkasko").getTotalValue());
|
assertEquals(21, report.getRow("Vollkasko").getTotalValue());
|
||||||
assertEquals(29, report.getRow("Teilkasko").getTotalValue());
|
assertEquals(29, report.getRow("Teilkasko").getTotalValue());
|
||||||
|
|
||||||
assertEquals(0, report.getRow("Vollkasko").getCells().length);
|
assertEquals(0, report.getRow("Vollkasko").getCells().length);
|
||||||
assertEquals(0, report.getRow("Teilkasko").getCells().length);
|
assertEquals(0, report.getRow("Teilkasko").getCells().length);
|
||||||
|
|
||||||
assertEquals(50, report.getSumRow().getTotalValue());
|
assertEquals(50, report.getSumRow().getTotalValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetCustomFieldValueReportWithReportLineItemDefinitions()
|
public void testGetCustomFieldValueReportWithReportLineItemDefinitions()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
||||||
customField, null,
|
customField, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
assertEquals(25, report.getRow("Geschaeftsstelle A").getTotalValue());
|
assertEquals(25, report.getRow("Geschaeftsstelle A").getTotalValue());
|
||||||
assertEquals(10, report.getRow("Geschaeftsstelle B").getTotalValue());
|
assertEquals(10, report.getRow("Geschaeftsstelle B").getTotalValue());
|
||||||
assertEquals(15, report.getRow("Geschaeftsstelle C").getTotalValue());
|
assertEquals(15, report.getRow("Geschaeftsstelle C").getTotalValue());
|
||||||
|
|
||||||
assertArrayEquals(new int[] {10, 9, 11, 0, 4, 0, 7, 4, 5}, report.getSumRow().getCells());
|
assertArrayEquals(new int[] {10, 9, 11, 0, 4, 0, 7, 4, 5}, report.getSumRow().getCells());
|
||||||
|
|
||||||
assertEquals(50, report.getSumRow().getTotalValue());
|
assertEquals(50, report.getSumRow().getTotalValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCustomFieldValueReport() throws InvalidArgumentException, NotAuthorizedException {
|
public void testEachItemOfCustomFieldValueReport() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
||||||
customField, null,
|
customField, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
||||||
assertArrayEquals(new int[] {11, 4, 3, 4, 3}, row1);
|
assertArrayEquals(new int[] {11, 4, 3, 4, 3}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
||||||
assertArrayEquals(new int[] {5, 3, 0, 2, 0}, row2);
|
assertArrayEquals(new int[] {5, 3, 0, 2, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
||||||
assertArrayEquals(new int[] {3, 4, 1, 1, 6}, row3);
|
assertArrayEquals(new int[] {3, 4, 1, 1, 6}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCustomFieldValueReportNotInWorkingDays()
|
public void testEachItemOfCustomFieldValueReportNotInWorkingDays()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
||||||
customField, null,
|
customField, null,
|
||||||
columnHeaders, false);
|
columnHeaders, false);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
||||||
assertArrayEquals(new int[] {15, 0, 3, 0, 7}, row1);
|
assertArrayEquals(new int[] {15, 0, 3, 0, 7}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
||||||
assertArrayEquals(new int[] {8, 0, 0, 0, 2}, row2);
|
assertArrayEquals(new int[] {8, 0, 0, 0, 2}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
||||||
assertArrayEquals(new int[] {7, 0, 1, 0, 7}, row3);
|
assertArrayEquals(new int[] {7, 0, 1, 0, 7}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCustomFieldValueReportWithWorkbasketFilter()
|
public void testEachItemOfCustomFieldValueReportWithWorkbasketFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(workbasketIds, null, null, null,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(workbasketIds, null, null, null,
|
||||||
customField, null,
|
customField, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
||||||
assertArrayEquals(new int[] {6, 1, 1, 1, 1}, row1);
|
assertArrayEquals(new int[] {6, 1, 1, 1, 1}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
||||||
assertArrayEquals(new int[] {4, 1, 0, 0, 0}, row2);
|
assertArrayEquals(new int[] {4, 1, 0, 0, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
||||||
assertArrayEquals(new int[] {3, 1, 0, 0, 1}, row3);
|
assertArrayEquals(new int[] {3, 1, 0, 0, 1}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCustomFieldValueReportWithStateFilter()
|
public void testEachItemOfCustomFieldValueReportWithStateFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, states, null, null,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, states, null, null,
|
||||||
customField, null,
|
customField, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
||||||
assertArrayEquals(new int[] {11, 4, 3, 4, 0}, row1);
|
assertArrayEquals(new int[] {11, 4, 3, 4, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
||||||
assertArrayEquals(new int[] {5, 3, 0, 2, 0}, row2);
|
assertArrayEquals(new int[] {5, 3, 0, 2, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
||||||
assertArrayEquals(new int[] {3, 4, 1, 1, 0}, row3);
|
assertArrayEquals(new int[] {3, 4, 1, 1, 0}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCustomFieldValueReportWithCategoryFilter()
|
public void testEachItemOfCustomFieldValueReportWithCategoryFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, categories, null,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, categories, null,
|
||||||
customField, null,
|
customField, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 2, 1, 3}, row1);
|
assertArrayEquals(new int[] {2, 1, 2, 1, 3}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
||||||
assertArrayEquals(new int[] {2, 0, 0, 0, 0}, row2);
|
assertArrayEquals(new int[] {2, 0, 0, 0, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
||||||
assertArrayEquals(new int[] {0, 2, 0, 0, 4}, row3);
|
assertArrayEquals(new int[] {0, 2, 0, 0, 4}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCustomFieldValueReportWithDomainFilter()
|
public void testEachItemOfCustomFieldValueReportWithDomainFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> domains = Collections.singletonList("DOMAIN_A");
|
List<String> domains = Collections.singletonList("DOMAIN_A");
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, domains,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, domains,
|
||||||
customField, null,
|
customField, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
||||||
assertArrayEquals(new int[] {8, 1, 1, 4, 1}, row1);
|
assertArrayEquals(new int[] {8, 1, 1, 4, 1}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 0, 1, 0}, row2);
|
assertArrayEquals(new int[] {2, 2, 0, 1, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
|
||||||
assertArrayEquals(new int[] {1, 1, 1, 0, 3}, row3);
|
assertArrayEquals(new int[] {1, 1, 1, 0, 3}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfCustomFieldValueReportWithCustomFieldValueFilter()
|
public void testEachItemOfCustomFieldValueReportWithCustomFieldValueFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null,
|
||||||
customField,
|
customField,
|
||||||
customFieldValues, columnHeaders);
|
customFieldValues, columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(1, report.rowSize());
|
assertEquals(1, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
|
||||||
assertArrayEquals(new int[] {11, 4, 3, 4, 3}, row1);
|
assertArrayEquals(new int[] {11, 4, 3, 4, 3}, row1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -6));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -6));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-5, -1));
|
columnHeaders.add(new TimeIntervalColumnHeader(-5, -1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1, 5));
|
columnHeaders.add(new TimeIntervalColumnHeader(1, 5));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(6, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(6, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String reportToString(CustomFieldValueReport report) {
|
private String reportToString(CustomFieldValueReport report) {
|
||||||
return reportToString(report, null);
|
return reportToString(report, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String reportToString(CustomFieldValueReport report, List<TimeIntervalColumnHeader> columnHeaders) {
|
private String reportToString(CustomFieldValueReport report, List<TimeIntervalColumnHeader> columnHeaders) {
|
||||||
String formatColumWidth = "| %-7s ";
|
String formatColumWidth = "| %-7s ";
|
||||||
String formatFirstColumn = "| %-36s %-4s ";
|
String formatFirstColumn = "| %-36s %-4s ";
|
||||||
String formatFirstColumnFirstLine = "| %-29s %12s ";
|
String formatFirstColumnFirstLine = "| %-29s %12s ";
|
||||||
String formatFirstColumnSumLine = "| %-36s %-5s";
|
String formatFirstColumnSumLine = "| %-36s %-5s";
|
||||||
int reportWidth = columnHeaders == null ? 46 : columnHeaders.size() * 10 + 46;
|
int reportWidth = columnHeaders == null ? 46 : columnHeaders.size() * 10 + 46;
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
builder.append(String.format(formatFirstColumnFirstLine, "Custom field values", "Total"));
|
builder.append(String.format(formatFirstColumnFirstLine, "Custom field values", "Total"));
|
||||||
if (columnHeaders != null) {
|
if (columnHeaders != null) {
|
||||||
for (TimeIntervalColumnHeader def : columnHeaders) {
|
for (TimeIntervalColumnHeader def : columnHeaders) {
|
||||||
if (def.getLowerAgeLimit() == Integer.MIN_VALUE) {
|
if (def.getLowerAgeLimit() == Integer.MIN_VALUE) {
|
||||||
builder.append(String.format(formatColumWidth, "< " + def.getUpperAgeLimit()));
|
builder.append(String.format(formatColumWidth, "< " + def.getUpperAgeLimit()));
|
||||||
} else if (def.getUpperAgeLimit() == Integer.MAX_VALUE) {
|
} else if (def.getUpperAgeLimit() == Integer.MAX_VALUE) {
|
||||||
builder.append(String.format(formatColumWidth, "> " + def.getLowerAgeLimit()));
|
builder.append(String.format(formatColumWidth, "> " + def.getLowerAgeLimit()));
|
||||||
} else if (def.getLowerAgeLimit() == def.getUpperAgeLimit()) {
|
} else if (def.getLowerAgeLimit() == def.getUpperAgeLimit()) {
|
||||||
if (def.getLowerAgeLimit() == 0) {
|
if (def.getLowerAgeLimit() == 0) {
|
||||||
builder.append(String.format(formatColumWidth, "today"));
|
builder.append(String.format(formatColumWidth, "today"));
|
||||||
} else {
|
} else {
|
||||||
builder.append(String.format(formatColumWidth, def.getLowerAgeLimit()));
|
builder.append(String.format(formatColumWidth, def.getLowerAgeLimit()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
builder.append(
|
builder.append(
|
||||||
String.format(formatColumWidth, def.getLowerAgeLimit() + ".." + def.getUpperAgeLimit()));
|
String.format(formatColumWidth, def.getLowerAgeLimit() + ".." + def.getUpperAgeLimit()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
|
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
|
|
||||||
for (String rl : report.rowTitles()) {
|
for (String rl : report.rowTitles()) {
|
||||||
builder
|
builder
|
||||||
.append(String.format(formatFirstColumn, rl, report.getRow(rl).getTotalValue()));
|
.append(String.format(formatFirstColumn, rl, report.getRow(rl).getTotalValue()));
|
||||||
if (columnHeaders != null) {
|
if (columnHeaders != null) {
|
||||||
for (int cell : report.getRow(rl).getCells()) {
|
for (int cell : report.getRow(rl).getCells()) {
|
||||||
builder.append(String.format(formatColumWidth, cell));
|
builder.append(String.format(formatColumWidth, cell));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
}
|
}
|
||||||
builder.append(String.format(formatFirstColumnSumLine, "Total", report.getSumRow().getTotalValue()));
|
builder.append(String.format(formatFirstColumnSumLine, "Total", report.getSumRow().getTotalValue()));
|
||||||
for (int cell : report.getSumRow().getCells()) {
|
for (int cell : report.getSumRow().getCells()) {
|
||||||
builder.append(String.format(formatColumWidth, cell));
|
builder.append(String.format(formatColumWidth, cell));
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,432 +1,432 @@
|
||||||
package acceptance.monitoring;
|
package acceptance.monitoring;
|
||||||
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import pro.taskana.CustomField;
|
import pro.taskana.CustomField;
|
||||||
import pro.taskana.TaskMonitorService;
|
import pro.taskana.TaskMonitorService;
|
||||||
import pro.taskana.TaskState;
|
import pro.taskana.TaskState;
|
||||||
import pro.taskana.TaskanaEngine;
|
import pro.taskana.TaskanaEngine;
|
||||||
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
|
||||||
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
||||||
import pro.taskana.database.TestDataGenerator;
|
import pro.taskana.database.TestDataGenerator;
|
||||||
import pro.taskana.exceptions.InvalidArgumentException;
|
import pro.taskana.exceptions.InvalidArgumentException;
|
||||||
import pro.taskana.exceptions.NotAuthorizedException;
|
import pro.taskana.exceptions.NotAuthorizedException;
|
||||||
import pro.taskana.impl.configuration.DBCleaner;
|
import pro.taskana.impl.configuration.DBCleaner;
|
||||||
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
|
||||||
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
||||||
import pro.taskana.impl.report.impl.WorkbasketLevelReport;
|
import pro.taskana.impl.report.impl.WorkbasketLevelReport;
|
||||||
import pro.taskana.security.JAASRunner;
|
import pro.taskana.security.JAASRunner;
|
||||||
import pro.taskana.security.WithAccessId;
|
import pro.taskana.security.WithAccessId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acceptance test for all "workbasket level report" scenarios.
|
* Acceptance test for all "workbasket level report" scenarios.
|
||||||
*/
|
*/
|
||||||
@RunWith(JAASRunner.class)
|
@RunWith(JAASRunner.class)
|
||||||
public class ProvideWorkbasketLevelReportAccTest {
|
public class ProvideWorkbasketLevelReportAccTest {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ProvideWorkbasketLevelReportAccTest.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(ProvideWorkbasketLevelReportAccTest.class);
|
||||||
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
||||||
protected static TaskanaEngine taskanaEngine;
|
protected static TaskanaEngine taskanaEngine;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupTest() throws Exception {
|
public static void setupTest() throws Exception {
|
||||||
resetDb();
|
resetDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void resetDb() throws SQLException, IOException {
|
public static void resetDb() throws SQLException, IOException {
|
||||||
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
DBCleaner cleaner = new DBCleaner();
|
DBCleaner cleaner = new DBCleaner();
|
||||||
cleaner.clearDb(dataSource, true);
|
cleaner.clearDb(dataSource, true);
|
||||||
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
dataSource = TaskanaEngineConfigurationTest.getDataSource();
|
||||||
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
|
||||||
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
|
||||||
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
taskanaEngine.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
taskanaEngine.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
||||||
cleaner.clearDb(dataSource, false);
|
cleaner.clearDb(dataSource, false);
|
||||||
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
TestDataGenerator testDataGenerator = new TestDataGenerator();
|
||||||
testDataGenerator.generateMonitoringTestData(dataSource);
|
testDataGenerator.generateMonitoringTestData(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = NotAuthorizedException.class)
|
@Test(expected = NotAuthorizedException.class)
|
||||||
public void testRoleCheck()
|
public void testRoleCheck()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null);
|
taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetTotalNumbersOfTasksOfWorkbasketLevelReport()
|
public void testGetTotalNumbersOfTasksOfWorkbasketLevelReport()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null);
|
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report));
|
LOGGER.debug(reportToString(report));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
assertEquals(20, report.getRow("USER_1_1").getTotalValue());
|
assertEquals(20, report.getRow("USER_1_1").getTotalValue());
|
||||||
assertEquals(20, report.getRow("USER_1_2").getTotalValue());
|
assertEquals(20, report.getRow("USER_1_2").getTotalValue());
|
||||||
assertEquals(10, report.getRow("USER_1_3").getTotalValue());
|
assertEquals(10, report.getRow("USER_1_3").getTotalValue());
|
||||||
|
|
||||||
assertEquals(50, report.getSumRow().getTotalValue());
|
assertEquals(50, report.getSumRow().getTotalValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testGetWorkbasketLevelReportWithReportLineItemDefinitions()
|
public void testGetWorkbasketLevelReportWithReportLineItemDefinitions()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||||
|
|
||||||
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null,
|
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
int sumLineCount = IntStream.of(report.getSumRow().getCells()).sum();
|
int sumLineCount = IntStream.of(report.getSumRow().getCells()).sum();
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
assertEquals(20, report.getRow("USER_1_1").getTotalValue());
|
assertEquals(20, report.getRow("USER_1_1").getTotalValue());
|
||||||
assertEquals(20, report.getRow("USER_1_2").getTotalValue());
|
assertEquals(20, report.getRow("USER_1_2").getTotalValue());
|
||||||
assertEquals(10, report.getRow("USER_1_3").getTotalValue());
|
assertEquals(10, report.getRow("USER_1_3").getTotalValue());
|
||||||
|
|
||||||
int[] sumRow = report.getSumRow().getCells();
|
int[] sumRow = report.getSumRow().getCells();
|
||||||
assertArrayEquals(new int[] {10, 9, 11, 0, 4, 0, 7, 4, 5}, sumRow);
|
assertArrayEquals(new int[] {10, 9, 11, 0, 4, 0, 7, 4, 5}, sumRow);
|
||||||
|
|
||||||
assertEquals(50, report.getSumRow().getTotalValue());
|
assertEquals(50, report.getSumRow().getTotalValue());
|
||||||
assertEquals(50, sumLineCount);
|
assertEquals(50, sumLineCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfWorkbasketLevelReport() throws InvalidArgumentException, NotAuthorizedException {
|
public void testEachItemOfWorkbasketLevelReport() throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null,
|
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("USER_1_1").getCells();
|
int[] row1 = report.getRow("USER_1_1").getCells();
|
||||||
assertArrayEquals(new int[] {13, 3, 1, 1, 2}, row1);
|
assertArrayEquals(new int[] {13, 3, 1, 1, 2}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("USER_1_2").getCells();
|
int[] row2 = report.getRow("USER_1_2").getCells();
|
||||||
assertArrayEquals(new int[] {4, 6, 3, 6, 1}, row2);
|
assertArrayEquals(new int[] {4, 6, 3, 6, 1}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("USER_1_3").getCells();
|
int[] row3 = report.getRow("USER_1_3").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 0, 0, 6}, row3);
|
assertArrayEquals(new int[] {2, 2, 0, 0, 6}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfWorkbasketLevelReportNotInWorkingDays()
|
public void testEachItemOfWorkbasketLevelReportNotInWorkingDays()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null,
|
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null, null, null,
|
||||||
columnHeaders, false);
|
columnHeaders, false);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("USER_1_1").getCells();
|
int[] row1 = report.getRow("USER_1_1").getCells();
|
||||||
assertArrayEquals(new int[] {16, 0, 1, 0, 3}, row1);
|
assertArrayEquals(new int[] {16, 0, 1, 0, 3}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("USER_1_2").getCells();
|
int[] row2 = report.getRow("USER_1_2").getCells();
|
||||||
assertArrayEquals(new int[] {10, 0, 3, 0, 7}, row2);
|
assertArrayEquals(new int[] {10, 0, 3, 0, 7}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("USER_1_3").getCells();
|
int[] row3 = report.getRow("USER_1_3").getCells();
|
||||||
assertArrayEquals(new int[] {4, 0, 0, 0, 6}, row3);
|
assertArrayEquals(new int[] {4, 0, 0, 0, 6}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfWorkbasketLevelReportWithWorkbasketFilter()
|
public void testEachItemOfWorkbasketLevelReportWithWorkbasketFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(workbasketIds, null, null, null,
|
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(workbasketIds, null, null, null,
|
||||||
null, null,
|
null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(1, report.rowSize());
|
assertEquals(1, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("USER_1_1").getCells();
|
int[] row1 = report.getRow("USER_1_1").getCells();
|
||||||
assertArrayEquals(new int[] {13, 3, 1, 1, 2}, row1);
|
assertArrayEquals(new int[] {13, 3, 1, 1, 2}, row1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfWorkbasketLevelReportWithStateFilter()
|
public void testEachItemOfWorkbasketLevelReportWithStateFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
List<TaskState> states = Collections.singletonList(TaskState.READY);
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, states, null, null, null, null,
|
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, states, null, null, null, null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("USER_1_1").getCells();
|
int[] row1 = report.getRow("USER_1_1").getCells();
|
||||||
assertArrayEquals(new int[] {13, 3, 1, 1, 0}, row1);
|
assertArrayEquals(new int[] {13, 3, 1, 1, 0}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("USER_1_2").getCells();
|
int[] row2 = report.getRow("USER_1_2").getCells();
|
||||||
assertArrayEquals(new int[] {4, 6, 3, 6, 0}, row2);
|
assertArrayEquals(new int[] {4, 6, 3, 6, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("USER_1_3").getCells();
|
int[] row3 = report.getRow("USER_1_3").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 0, 0, 0}, row3);
|
assertArrayEquals(new int[] {2, 2, 0, 0, 0}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfWorkbasketLevelReportWithCategoryFilter()
|
public void testEachItemOfWorkbasketLevelReportWithCategoryFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, categories, null, null,
|
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, categories, null, null,
|
||||||
null,
|
null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("USER_1_1").getCells();
|
int[] row1 = report.getRow("USER_1_1").getCells();
|
||||||
assertArrayEquals(new int[] {3, 1, 1, 1, 2}, row1);
|
assertArrayEquals(new int[] {3, 1, 1, 1, 2}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("USER_1_2").getCells();
|
int[] row2 = report.getRow("USER_1_2").getCells();
|
||||||
assertArrayEquals(new int[] {1, 1, 1, 0, 1}, row2);
|
assertArrayEquals(new int[] {1, 1, 1, 0, 1}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("USER_1_3").getCells();
|
int[] row3 = report.getRow("USER_1_3").getCells();
|
||||||
assertArrayEquals(new int[] {0, 1, 0, 0, 4}, row3);
|
assertArrayEquals(new int[] {0, 1, 0, 0, 4}, row3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfWorkbasketLevelReportWithDomainFilter()
|
public void testEachItemOfWorkbasketLevelReportWithDomainFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
List<String> domains = Collections.singletonList("DOMAIN_A");
|
List<String> domains = Collections.singletonList("DOMAIN_A");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, domains, null,
|
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, domains, null,
|
||||||
null,
|
null,
|
||||||
columnHeaders);
|
columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("USER_1_1").getCells();
|
int[] row1 = report.getRow("USER_1_1").getCells();
|
||||||
assertArrayEquals(new int[] {8, 1, 0, 1, 2}, row1);
|
assertArrayEquals(new int[] {8, 1, 0, 1, 2}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("USER_1_2").getCells();
|
int[] row2 = report.getRow("USER_1_2").getCells();
|
||||||
assertArrayEquals(new int[] {2, 2, 2, 4, 0}, row2);
|
assertArrayEquals(new int[] {2, 2, 2, 4, 0}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("USER_1_3").getCells();
|
int[] row3 = report.getRow("USER_1_3").getCells();
|
||||||
assertArrayEquals(new int[] {1, 1, 0, 0, 2}, row3);
|
assertArrayEquals(new int[] {1, 1, 0, 0, 2}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "monitor")
|
userName = "monitor")
|
||||||
@Test
|
@Test
|
||||||
public void testEachItemOfWorkbasketLevelReportWithCustomFieldValueFilter()
|
public void testEachItemOfWorkbasketLevelReportWithCustomFieldValueFilter()
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
|
||||||
|
|
||||||
CustomField customField = CustomField.CUSTOM_1;
|
CustomField customField = CustomField.CUSTOM_1;
|
||||||
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
|
||||||
|
|
||||||
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null,
|
WorkbasketLevelReport report = taskMonitorService.getWorkbasketLevelReport(null, null, null, null,
|
||||||
customField, customFieldValues, columnHeaders);
|
customField, customFieldValues, columnHeaders);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug(reportToString(report, columnHeaders));
|
LOGGER.debug(reportToString(report, columnHeaders));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotNull(report);
|
assertNotNull(report);
|
||||||
assertEquals(3, report.rowSize());
|
assertEquals(3, report.rowSize());
|
||||||
|
|
||||||
int[] row1 = report.getRow("USER_1_1").getCells();
|
int[] row1 = report.getRow("USER_1_1").getCells();
|
||||||
assertArrayEquals(new int[] {6, 1, 1, 1, 1}, row1);
|
assertArrayEquals(new int[] {6, 1, 1, 1, 1}, row1);
|
||||||
|
|
||||||
int[] row2 = report.getRow("USER_1_2").getCells();
|
int[] row2 = report.getRow("USER_1_2").getCells();
|
||||||
assertArrayEquals(new int[] {3, 2, 2, 3, 1}, row2);
|
assertArrayEquals(new int[] {3, 2, 2, 3, 1}, row2);
|
||||||
|
|
||||||
int[] row3 = report.getRow("USER_1_3").getCells();
|
int[] row3 = report.getRow("USER_1_3").getCells();
|
||||||
assertArrayEquals(new int[] {2, 1, 0, 0, 1}, row3);
|
assertArrayEquals(new int[] {2, 1, 0, 0, 1}, row3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -6));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -6));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-5, -1));
|
columnHeaders.add(new TimeIntervalColumnHeader(-5, -1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1, 5));
|
columnHeaders.add(new TimeIntervalColumnHeader(1, 5));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(6, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(6, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String reportToString(WorkbasketLevelReport report) {
|
private String reportToString(WorkbasketLevelReport report) {
|
||||||
return reportToString(report, null);
|
return reportToString(report, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String reportToString(WorkbasketLevelReport report,
|
private String reportToString(WorkbasketLevelReport report,
|
||||||
List<TimeIntervalColumnHeader> reportLineItemDefinitions) {
|
List<TimeIntervalColumnHeader> reportLineItemDefinitions) {
|
||||||
String formatColumWidth = "| %-7s ";
|
String formatColumWidth = "| %-7s ";
|
||||||
String formatFirstColumn = "| %-36s %-4s ";
|
String formatFirstColumn = "| %-36s %-4s ";
|
||||||
String formatFirstColumnFirstLine = "| %-29s %12s ";
|
String formatFirstColumnFirstLine = "| %-29s %12s ";
|
||||||
String formatFirstColumnSumLine = "| %-36s %-5s";
|
String formatFirstColumnSumLine = "| %-36s %-5s";
|
||||||
int reportWidth = reportLineItemDefinitions == null ? 46 : reportLineItemDefinitions.size() * 10 + 46;
|
int reportWidth = reportLineItemDefinitions == null ? 46 : reportLineItemDefinitions.size() * 10 + 46;
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
builder.append(String.format(formatFirstColumnFirstLine, "Workbasket levels", "Total"));
|
builder.append(String.format(formatFirstColumnFirstLine, "Workbasket levels", "Total"));
|
||||||
if (reportLineItemDefinitions != null) {
|
if (reportLineItemDefinitions != null) {
|
||||||
for (TimeIntervalColumnHeader def : reportLineItemDefinitions) {
|
for (TimeIntervalColumnHeader def : reportLineItemDefinitions) {
|
||||||
if (def.getLowerAgeLimit() == Integer.MIN_VALUE) {
|
if (def.getLowerAgeLimit() == Integer.MIN_VALUE) {
|
||||||
builder.append(String.format(formatColumWidth, "< " + def.getUpperAgeLimit()));
|
builder.append(String.format(formatColumWidth, "< " + def.getUpperAgeLimit()));
|
||||||
} else if (def.getUpperAgeLimit() == Integer.MAX_VALUE) {
|
} else if (def.getUpperAgeLimit() == Integer.MAX_VALUE) {
|
||||||
builder.append(String.format(formatColumWidth, "> " + def.getLowerAgeLimit()));
|
builder.append(String.format(formatColumWidth, "> " + def.getLowerAgeLimit()));
|
||||||
} else if (def.getLowerAgeLimit() == def.getUpperAgeLimit()) {
|
} else if (def.getLowerAgeLimit() == def.getUpperAgeLimit()) {
|
||||||
if (def.getLowerAgeLimit() == 0) {
|
if (def.getLowerAgeLimit() == 0) {
|
||||||
builder.append(String.format(formatColumWidth, "today"));
|
builder.append(String.format(formatColumWidth, "today"));
|
||||||
} else {
|
} else {
|
||||||
builder.append(String.format(formatColumWidth, def.getLowerAgeLimit()));
|
builder.append(String.format(formatColumWidth, def.getLowerAgeLimit()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
builder.append(
|
builder.append(
|
||||||
String.format(formatColumWidth, def.getLowerAgeLimit() + ".." + def.getUpperAgeLimit()));
|
String.format(formatColumWidth, def.getLowerAgeLimit() + ".." + def.getUpperAgeLimit()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
|
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
|
|
||||||
for (String rl : report.rowTitles()) {
|
for (String rl : report.rowTitles()) {
|
||||||
builder
|
builder
|
||||||
.append(String.format(formatFirstColumn, rl, report.getRow(rl).getTotalValue()));
|
.append(String.format(formatFirstColumn, rl, report.getRow(rl).getTotalValue()));
|
||||||
if (reportLineItemDefinitions != null) {
|
if (reportLineItemDefinitions != null) {
|
||||||
for (int cell : report.getRow(rl).getCells()) {
|
for (int cell : report.getRow(rl).getCells()) {
|
||||||
builder.append(String.format(formatColumWidth, cell));
|
builder.append(String.format(formatColumWidth, cell));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
}
|
}
|
||||||
builder.append(String.format(formatFirstColumnSumLine, "Total", report.getSumRow().getTotalValue()));
|
builder.append(String.format(formatFirstColumnSumLine, "Total", report.getSumRow().getTotalValue()));
|
||||||
for (int cell : report.getSumRow().getCells()) {
|
for (int cell : report.getSumRow().getCells()) {
|
||||||
builder.append(String.format(formatColumWidth, cell));
|
builder.append(String.format(formatColumWidth, cell));
|
||||||
}
|
}
|
||||||
builder.append("|\n");
|
builder.append("|\n");
|
||||||
for (int i = 0; i < reportWidth; i++) {
|
for (int i = 0; i < reportWidth; i++) {
|
||||||
builder.append("-");
|
builder.append("-");
|
||||||
}
|
}
|
||||||
builder.append("\n");
|
builder.append("\n");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,194 +1,194 @@
|
||||||
package pro.taskana.database;
|
package pro.taskana.database;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.apache.ibatis.jdbc.ScriptRunner;
|
import org.apache.ibatis.jdbc.ScriptRunner;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import pro.taskana.configuration.DbSchemaCreator;
|
import pro.taskana.configuration.DbSchemaCreator;
|
||||||
import pro.taskana.impl.TaskanaEngineImpl;
|
import pro.taskana.impl.TaskanaEngineImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the test data for integration and acceptance tests.
|
* Generates the test data for integration and acceptance tests.
|
||||||
*/
|
*/
|
||||||
public class TestDataGenerator {
|
public class TestDataGenerator {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(DbSchemaCreator.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(DbSchemaCreator.class);
|
||||||
private static final String SQL = "/sql";
|
private static final String SQL = "/sql";
|
||||||
private static final String TASK = SQL + "/task.sql";
|
private static final String TASK = SQL + "/task.sql";
|
||||||
private static final String WORKBASKET = SQL + "/workbasket.sql";
|
private static final String WORKBASKET = SQL + "/workbasket.sql";
|
||||||
private static final String DISTRIBUTION_TARGETS = SQL + "/distribution-targets.sql";
|
private static final String DISTRIBUTION_TARGETS = SQL + "/distribution-targets.sql";
|
||||||
private static final String WORKBASKET_ACCESS_LIST = SQL + "/workbasket-access-list.sql";
|
private static final String WORKBASKET_ACCESS_LIST = SQL + "/workbasket-access-list.sql";
|
||||||
private static final String CLASSIFICATION = SQL + "/classification.sql";
|
private static final String CLASSIFICATION = SQL + "/classification.sql";
|
||||||
private static final String OBJECT_REFERENCE = SQL + "/object-reference.sql";
|
private static final String OBJECT_REFERENCE = SQL + "/object-reference.sql";
|
||||||
private static final String ATTACHMENT = SQL + "/attachment.sql";
|
private static final String ATTACHMENT = SQL + "/attachment.sql";
|
||||||
private static final String MONITOR_SAMPLE_DATA = SQL + "/monitor-sample-data.sql";
|
private static final String MONITOR_SAMPLE_DATA = SQL + "/monitor-sample-data.sql";
|
||||||
private static SQLReplacer sqlReplacer;
|
private static SQLReplacer sqlReplacer;
|
||||||
|
|
||||||
private StringWriter outWriter = new StringWriter();
|
private StringWriter outWriter = new StringWriter();
|
||||||
private PrintWriter logWriter;
|
private PrintWriter logWriter;
|
||||||
private StringWriter errorWriter;
|
private StringWriter errorWriter;
|
||||||
private PrintWriter errorLogWriter;
|
private PrintWriter errorLogWriter;
|
||||||
|
|
||||||
public TestDataGenerator() {
|
public TestDataGenerator() {
|
||||||
this.logWriter = new PrintWriter(this.outWriter);
|
this.logWriter = new PrintWriter(this.outWriter);
|
||||||
this.errorWriter = new StringWriter();
|
this.errorWriter = new StringWriter();
|
||||||
this.errorLogWriter = new PrintWriter(this.errorWriter);
|
this.errorLogWriter = new PrintWriter(this.errorWriter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateTestData(DataSource dataSource) throws SQLException, IOException {
|
public void generateTestData(DataSource dataSource) throws SQLException, IOException {
|
||||||
ScriptRunner runner = null;
|
ScriptRunner runner = null;
|
||||||
try {
|
try {
|
||||||
Connection connection = dataSource.getConnection();
|
Connection connection = dataSource.getConnection();
|
||||||
LOGGER.debug(connection.getMetaData().toString());
|
LOGGER.debug(connection.getMetaData().toString());
|
||||||
runner = new ScriptRunner(connection);
|
runner = new ScriptRunner(connection);
|
||||||
runner.setStopOnError(true);
|
runner.setStopOnError(true);
|
||||||
runner.setLogWriter(this.logWriter);
|
runner.setLogWriter(this.logWriter);
|
||||||
runner.setErrorLogWriter(this.errorLogWriter);
|
runner.setErrorLogWriter(this.errorLogWriter);
|
||||||
runner.setStopOnError(true);
|
runner.setStopOnError(true);
|
||||||
runner.setLogWriter(this.logWriter);
|
runner.setLogWriter(this.logWriter);
|
||||||
runner.setErrorLogWriter(this.errorLogWriter);
|
runner.setErrorLogWriter(this.errorLogWriter);
|
||||||
|
|
||||||
if (sqlReplacer == null) {
|
if (sqlReplacer == null) {
|
||||||
sqlReplacer = new SQLReplacer(connection.getMetaData().getDatabaseProductName());
|
sqlReplacer = new SQLReplacer(connection.getMetaData().getDatabaseProductName());
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream.of(sqlReplacer.classificationSql, sqlReplacer.workbasketSql, sqlReplacer.taskSql,
|
Stream.of(sqlReplacer.classificationSql, sqlReplacer.workbasketSql, sqlReplacer.taskSql,
|
||||||
sqlReplacer.workbasketAccessListSql, sqlReplacer.distributionTargetSql, sqlReplacer.objectReferenceSql,
|
sqlReplacer.workbasketAccessListSql, sqlReplacer.distributionTargetSql, sqlReplacer.objectReferenceSql,
|
||||||
sqlReplacer.attachmentSql)
|
sqlReplacer.attachmentSql)
|
||||||
.map(s -> s.getBytes(StandardCharsets.UTF_8))
|
.map(s -> s.getBytes(StandardCharsets.UTF_8))
|
||||||
.map(ByteArrayInputStream::new)
|
.map(ByteArrayInputStream::new)
|
||||||
.map(InputStreamReader::new)
|
.map(InputStreamReader::new)
|
||||||
.forEach(runner::runScript);
|
.forEach(runner::runScript);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
if (runner != null) {
|
if (runner != null) {
|
||||||
runner.closeConnection();
|
runner.closeConnection();
|
||||||
}
|
}
|
||||||
LOGGER.debug(outWriter.toString());
|
LOGGER.debug(outWriter.toString());
|
||||||
if (!errorWriter.toString().trim().isEmpty()) {
|
if (!errorWriter.toString().trim().isEmpty()) {
|
||||||
LOGGER.error(errorWriter.toString());
|
LOGGER.error(errorWriter.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateMonitoringTestData(DataSource dataSource) throws IOException, SQLException {
|
public void generateMonitoringTestData(DataSource dataSource) throws IOException, SQLException {
|
||||||
ScriptRunner runner = null;
|
ScriptRunner runner = null;
|
||||||
try {
|
try {
|
||||||
Connection connection = dataSource.getConnection();
|
Connection connection = dataSource.getConnection();
|
||||||
LOGGER.debug(connection.getMetaData().toString());
|
LOGGER.debug(connection.getMetaData().toString());
|
||||||
runner = new ScriptRunner(connection);
|
runner = new ScriptRunner(connection);
|
||||||
runner.setStopOnError(true);
|
runner.setStopOnError(true);
|
||||||
runner.setLogWriter(this.logWriter);
|
runner.setLogWriter(this.logWriter);
|
||||||
runner.setErrorLogWriter(this.errorLogWriter);
|
runner.setErrorLogWriter(this.errorLogWriter);
|
||||||
runner.setStopOnError(true);
|
runner.setStopOnError(true);
|
||||||
runner.setLogWriter(this.logWriter);
|
runner.setLogWriter(this.logWriter);
|
||||||
runner.setErrorLogWriter(this.errorLogWriter);
|
runner.setErrorLogWriter(this.errorLogWriter);
|
||||||
|
|
||||||
if (sqlReplacer == null) {
|
if (sqlReplacer == null) {
|
||||||
sqlReplacer = new SQLReplacer(connection.getMetaData().getDatabaseProductName());
|
sqlReplacer = new SQLReplacer(connection.getMetaData().getDatabaseProductName());
|
||||||
}
|
}
|
||||||
|
|
||||||
runner.runScript(
|
runner.runScript(
|
||||||
new InputStreamReader(
|
new InputStreamReader(
|
||||||
new ByteArrayInputStream(
|
new ByteArrayInputStream(
|
||||||
sqlReplacer.monitoringTestDataSql.getBytes(StandardCharsets.UTF_8))));
|
sqlReplacer.monitoringTestDataSql.getBytes(StandardCharsets.UTF_8))));
|
||||||
} finally {
|
} finally {
|
||||||
if (runner != null) {
|
if (runner != null) {
|
||||||
runner.closeConnection();
|
runner.closeConnection();
|
||||||
}
|
}
|
||||||
LOGGER.debug(outWriter.toString());
|
LOGGER.debug(outWriter.toString());
|
||||||
if (!errorWriter.toString().trim().isEmpty()) {
|
if (!errorWriter.toString().trim().isEmpty()) {
|
||||||
LOGGER.error(errorWriter.toString());
|
LOGGER.error(errorWriter.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class replaces boolean values with int values if the database is db2.
|
* This class replaces boolean values with int values if the database is db2.
|
||||||
*/
|
*/
|
||||||
private static final class SQLReplacer {
|
private static final class SQLReplacer {
|
||||||
|
|
||||||
private String classificationSql;
|
private String classificationSql;
|
||||||
private String workbasketSql;
|
private String workbasketSql;
|
||||||
private String taskSql;
|
private String taskSql;
|
||||||
private String workbasketAccessListSql;
|
private String workbasketAccessListSql;
|
||||||
private String distributionTargetSql;
|
private String distributionTargetSql;
|
||||||
private String objectReferenceSql;
|
private String objectReferenceSql;
|
||||||
private String attachmentSql;
|
private String attachmentSql;
|
||||||
private String monitoringTestDataSql;
|
private String monitoringTestDataSql;
|
||||||
|
|
||||||
private SQLReplacer(String dbProductName) throws IOException {
|
private SQLReplacer(String dbProductName) throws IOException {
|
||||||
boolean isDb2 = TaskanaEngineImpl.isDb2(dbProductName);
|
boolean isDb2 = TaskanaEngineImpl.isDb2(dbProductName);
|
||||||
classificationSql = parseAndReplace(getClass().getResourceAsStream(CLASSIFICATION), isDb2);
|
classificationSql = parseAndReplace(getClass().getResourceAsStream(CLASSIFICATION), isDb2);
|
||||||
workbasketSql = parseAndReplace(getClass().getResourceAsStream(WORKBASKET), isDb2);
|
workbasketSql = parseAndReplace(getClass().getResourceAsStream(WORKBASKET), isDb2);
|
||||||
taskSql = parseAndReplace(getClass().getResourceAsStream(TASK), isDb2);
|
taskSql = parseAndReplace(getClass().getResourceAsStream(TASK), isDb2);
|
||||||
workbasketAccessListSql = parseAndReplace(getClass().getResourceAsStream(WORKBASKET_ACCESS_LIST), isDb2);
|
workbasketAccessListSql = parseAndReplace(getClass().getResourceAsStream(WORKBASKET_ACCESS_LIST), isDb2);
|
||||||
distributionTargetSql = parseAndReplace(getClass().getResourceAsStream(DISTRIBUTION_TARGETS), isDb2);
|
distributionTargetSql = parseAndReplace(getClass().getResourceAsStream(DISTRIBUTION_TARGETS), isDb2);
|
||||||
objectReferenceSql = parseAndReplace(getClass().getResourceAsStream(OBJECT_REFERENCE), isDb2);
|
objectReferenceSql = parseAndReplace(getClass().getResourceAsStream(OBJECT_REFERENCE), isDb2);
|
||||||
attachmentSql = parseAndReplace(getClass().getResourceAsStream(ATTACHMENT), isDb2);
|
attachmentSql = parseAndReplace(getClass().getResourceAsStream(ATTACHMENT), isDb2);
|
||||||
monitoringTestDataSql = generateMonitoringSqlData(isDb2);
|
monitoringTestDataSql = generateMonitoringSqlData(isDb2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String parseAndReplace(InputStream stream, boolean replace) throws IOException {
|
private String parseAndReplace(InputStream stream, boolean replace) throws IOException {
|
||||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(stream));
|
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(stream));
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
String line;
|
String line;
|
||||||
if (replace) {
|
if (replace) {
|
||||||
while ((line = bufferedReader.readLine()) != null) {
|
while ((line = bufferedReader.readLine()) != null) {
|
||||||
sql.append(line.replaceAll("true|TRUE", "1").replaceAll("false|FALSE", "0")).append("\n");
|
sql.append(line.replaceAll("true|TRUE", "1").replaceAll("false|FALSE", "0")).append("\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while ((line = bufferedReader.readLine()) != null) {
|
while ((line = bufferedReader.readLine()) != null) {
|
||||||
sql.append(line).append("\n");
|
sql.append(line).append("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String generateMonitoringSqlData(boolean replace) throws IOException {
|
private String generateMonitoringSqlData(boolean replace) throws IOException {
|
||||||
String rawSql = parseAndReplace(getClass().getResourceAsStream(MONITOR_SAMPLE_DATA), replace);
|
String rawSql = parseAndReplace(getClass().getResourceAsStream(MONITOR_SAMPLE_DATA), replace);
|
||||||
|
|
||||||
BufferedReader bufferedReader = new BufferedReader(
|
BufferedReader bufferedReader = new BufferedReader(
|
||||||
new InputStreamReader(new ByteArrayInputStream(rawSql.getBytes(StandardCharsets.UTF_8))));
|
new InputStreamReader(new ByteArrayInputStream(rawSql.getBytes(StandardCharsets.UTF_8))));
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
String line;
|
String line;
|
||||||
|
|
||||||
List<Integer> ages = Arrays.asList(-70000, -14000, -2800, -1400, -1400, -700, -700, -35, -28, -28, -14, -14,
|
List<Integer> ages = Arrays.asList(-70000, -14000, -2800, -1400, -1400, -700, -700, -35, -28, -28, -14, -14,
|
||||||
-14, -14, -14, -14, -14, -14, -14, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, 0, 0, 0, 0, 7, 7, 7, 7,
|
-14, -14, -14, -14, -14, -14, -14, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, 0, 0, 0, 0, 7, 7, 7, 7,
|
||||||
7, 7,
|
7, 7,
|
||||||
7, 14, 14, 14, 14, 21, 210, 210, 28000, 700000);
|
7, 14, 14, 14, 14, 21, 210, 210, 28000, 700000);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while ((line = bufferedReader.readLine()) != null) {
|
while ((line = bufferedReader.readLine()) != null) {
|
||||||
if (line.contains("dueDate")) {
|
if (line.contains("dueDate")) {
|
||||||
line = line.replace("dueDate", "\'" + now.plusDays(ages.get(i)).format(formatter) + "\' ");
|
line = line.replace("dueDate", "\'" + now.plusDays(ages.get(i)).format(formatter) + "\' ");
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
sql.append(line).append("\n");
|
sql.append(line).append("\n");
|
||||||
}
|
}
|
||||||
bufferedReader.close();
|
bufferedReader.close();
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,398 +1,398 @@
|
||||||
package pro.taskana.impl;
|
package pro.taskana.impl;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotEquals;
|
import static org.junit.Assert.assertNotEquals;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import pro.taskana.exceptions.InvalidArgumentException;
|
import pro.taskana.exceptions.InvalidArgumentException;
|
||||||
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
import pro.taskana.impl.report.impl.TimeIntervalColumnHeader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for the DaysToWorkingDaysConverter.
|
* Test for the DaysToWorkingDaysConverter.
|
||||||
*/
|
*/
|
||||||
public class DaysToWorkingDaysConverterTest {
|
public class DaysToWorkingDaysConverterTest {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setup() {
|
public static void setup() {
|
||||||
DaysToWorkingDaysConverter.setGermanPublicHolidaysEnabled(true);
|
DaysToWorkingDaysConverter.setGermanPublicHolidaysEnabled(true);
|
||||||
LocalDate dayOfReformation = LocalDate.of(2018, 10, 31);
|
LocalDate dayOfReformation = LocalDate.of(2018, 10, 31);
|
||||||
LocalDate allSaintsDays = LocalDate.of(2018, 11, 1);
|
LocalDate allSaintsDays = LocalDate.of(2018, 11, 1);
|
||||||
DaysToWorkingDaysConverter.setCustomHolidays(Arrays.asList(dayOfReformation, allSaintsDays));
|
DaysToWorkingDaysConverter.setCustomHolidays(Arrays.asList(dayOfReformation, allSaintsDays));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInitializeForDifferentReportLineItemDefinitions() throws InvalidArgumentException {
|
public void testInitializeForDifferentReportLineItemDefinitions() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance1 = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance1 = DaysToWorkingDaysConverter
|
||||||
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-03T00:00:00.000Z"));
|
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-03T00:00:00.000Z"));
|
||||||
DaysToWorkingDaysConverter instance2 = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance2 = DaysToWorkingDaysConverter
|
||||||
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-03T00:00:00.000Z"));
|
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-03T00:00:00.000Z"));
|
||||||
DaysToWorkingDaysConverter instance3 = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance3 = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-02-03T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-02-03T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(instance1, instance2);
|
assertEquals(instance1, instance2);
|
||||||
assertNotEquals(instance1, instance3);
|
assertNotEquals(instance1, instance3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConvertWorkingDaysToDaysForTasks() {
|
public void testConvertWorkingDaysToDaysForTasks() {
|
||||||
List<TimeIntervalColumnHeader> reportItems = Collections.singletonList(new TimeIntervalColumnHeader(0));
|
List<TimeIntervalColumnHeader> reportItems = Collections.singletonList(new TimeIntervalColumnHeader(0));
|
||||||
try {
|
try {
|
||||||
DaysToWorkingDaysConverter converter = DaysToWorkingDaysConverter.initialize(reportItems, Instant.now());
|
DaysToWorkingDaysConverter converter = DaysToWorkingDaysConverter.initialize(reportItems, Instant.now());
|
||||||
|
|
||||||
Instant thursday0201 = Instant.parse("2018-02-01T07:00:00.000Z");
|
Instant thursday0201 = Instant.parse("2018-02-01T07:00:00.000Z");
|
||||||
long days = converter.convertWorkingDaysToDays(thursday0201, 0); // = thursday
|
long days = converter.convertWorkingDaysToDays(thursday0201, 0); // = thursday
|
||||||
assertEquals(0, days);
|
assertEquals(0, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 1); // fri
|
days = converter.convertWorkingDaysToDays(thursday0201, 1); // fri
|
||||||
assertEquals(1, days);
|
assertEquals(1, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 2); // mon
|
days = converter.convertWorkingDaysToDays(thursday0201, 2); // mon
|
||||||
assertEquals(4, days);
|
assertEquals(4, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 3); // tues
|
days = converter.convertWorkingDaysToDays(thursday0201, 3); // tues
|
||||||
assertEquals(5, days);
|
assertEquals(5, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 4); // we
|
days = converter.convertWorkingDaysToDays(thursday0201, 4); // we
|
||||||
assertEquals(6, days);
|
assertEquals(6, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 5); // thurs
|
days = converter.convertWorkingDaysToDays(thursday0201, 5); // thurs
|
||||||
assertEquals(7, days);
|
assertEquals(7, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 6); // fri
|
days = converter.convertWorkingDaysToDays(thursday0201, 6); // fri
|
||||||
assertEquals(8, days);
|
assertEquals(8, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 7); // mon
|
days = converter.convertWorkingDaysToDays(thursday0201, 7); // mon
|
||||||
assertEquals(11, days);
|
assertEquals(11, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 8); // tue
|
days = converter.convertWorkingDaysToDays(thursday0201, 8); // tue
|
||||||
assertEquals(12, days);
|
assertEquals(12, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 9); // we
|
days = converter.convertWorkingDaysToDays(thursday0201, 9); // we
|
||||||
assertEquals(13, days);
|
assertEquals(13, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 10); // thu
|
days = converter.convertWorkingDaysToDays(thursday0201, 10); // thu
|
||||||
assertEquals(14, days);
|
assertEquals(14, days);
|
||||||
days = converter.convertWorkingDaysToDays(thursday0201, 11); // fri
|
days = converter.convertWorkingDaysToDays(thursday0201, 11); // fri
|
||||||
assertEquals(15, days);
|
assertEquals(15, days);
|
||||||
|
|
||||||
Instant gruenDonnerstag2018 = Instant.parse("2018-03-29T01:00:00.000Z");
|
Instant gruenDonnerstag2018 = Instant.parse("2018-03-29T01:00:00.000Z");
|
||||||
days = converter.convertWorkingDaysToDays(gruenDonnerstag2018, 0);
|
days = converter.convertWorkingDaysToDays(gruenDonnerstag2018, 0);
|
||||||
assertEquals(0, days);
|
assertEquals(0, days);
|
||||||
days = converter.convertWorkingDaysToDays(gruenDonnerstag2018, 1); // Karfreitag
|
days = converter.convertWorkingDaysToDays(gruenDonnerstag2018, 1); // Karfreitag
|
||||||
assertEquals(5, days); // osterdienstag
|
assertEquals(5, days); // osterdienstag
|
||||||
days = converter.convertWorkingDaysToDays(gruenDonnerstag2018, 2); // Karfreitag
|
days = converter.convertWorkingDaysToDays(gruenDonnerstag2018, 2); // Karfreitag
|
||||||
assertEquals(6, days); // ostermittwoch
|
assertEquals(6, days); // ostermittwoch
|
||||||
|
|
||||||
Instant freitag0427 = Instant.parse("2018-04-27T19:00:00.000Z");
|
Instant freitag0427 = Instant.parse("2018-04-27T19:00:00.000Z");
|
||||||
days = converter.convertWorkingDaysToDays(freitag0427, 0);
|
days = converter.convertWorkingDaysToDays(freitag0427, 0);
|
||||||
assertEquals(0, days);
|
assertEquals(0, days);
|
||||||
days = converter.convertWorkingDaysToDays(freitag0427, 1);
|
days = converter.convertWorkingDaysToDays(freitag0427, 1);
|
||||||
assertEquals(3, days); // 30.4.
|
assertEquals(3, days); // 30.4.
|
||||||
days = converter.convertWorkingDaysToDays(freitag0427, 2);
|
days = converter.convertWorkingDaysToDays(freitag0427, 2);
|
||||||
assertEquals(5, days); // 2.5.
|
assertEquals(5, days); // 2.5.
|
||||||
|
|
||||||
} catch (InvalidArgumentException e) {
|
} catch (InvalidArgumentException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
fail("");
|
fail("");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInitializeForDifferentDates() throws InvalidArgumentException {
|
public void testInitializeForDifferentDates() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance1 = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance1 = DaysToWorkingDaysConverter
|
||||||
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-04T00:00:00.000Z"));
|
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-04T00:00:00.000Z"));
|
||||||
DaysToWorkingDaysConverter instance2 = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance2 = DaysToWorkingDaysConverter
|
||||||
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-05T00:00:00.000Z"));
|
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-05T00:00:00.000Z"));
|
||||||
|
|
||||||
assertNotEquals(instance1, instance2);
|
assertNotEquals(instance1, instance2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConvertDaysToWorkingDays() throws InvalidArgumentException {
|
public void testConvertDaysToWorkingDays() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-02-06T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-02-06T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(-16, instance.convertDaysToWorkingDays(-16));
|
assertEquals(-16, instance.convertDaysToWorkingDays(-16));
|
||||||
assertEquals(-11, instance.convertDaysToWorkingDays(-15));
|
assertEquals(-11, instance.convertDaysToWorkingDays(-15));
|
||||||
|
|
||||||
assertEquals(-2, instance.convertDaysToWorkingDays(-4));
|
assertEquals(-2, instance.convertDaysToWorkingDays(-4));
|
||||||
assertEquals(-1, instance.convertDaysToWorkingDays(-3));
|
assertEquals(-1, instance.convertDaysToWorkingDays(-3));
|
||||||
assertEquals(-1, instance.convertDaysToWorkingDays(-2));
|
assertEquals(-1, instance.convertDaysToWorkingDays(-2));
|
||||||
assertEquals(-1, instance.convertDaysToWorkingDays(-1));
|
assertEquals(-1, instance.convertDaysToWorkingDays(-1));
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(2));
|
assertEquals(2, instance.convertDaysToWorkingDays(2));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(3));
|
assertEquals(3, instance.convertDaysToWorkingDays(3));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(4));
|
assertEquals(3, instance.convertDaysToWorkingDays(4));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(5));
|
assertEquals(3, instance.convertDaysToWorkingDays(5));
|
||||||
assertEquals(4, instance.convertDaysToWorkingDays(6));
|
assertEquals(4, instance.convertDaysToWorkingDays(6));
|
||||||
|
|
||||||
assertEquals(11, instance.convertDaysToWorkingDays(15));
|
assertEquals(11, instance.convertDaysToWorkingDays(15));
|
||||||
assertEquals(16, instance.convertDaysToWorkingDays(16));
|
assertEquals(16, instance.convertDaysToWorkingDays(16));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConvertWorkingDaysToDays() throws InvalidArgumentException {
|
public void testConvertWorkingDaysToDays() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-02-27T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-02-27T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(Arrays.asList(-13), instance.convertWorkingDaysToDays(-13));
|
assertEquals(Arrays.asList(-13), instance.convertWorkingDaysToDays(-13));
|
||||||
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-12));
|
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-12));
|
||||||
|
|
||||||
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-8));
|
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-8));
|
||||||
assertEquals(Arrays.asList(-11), instance.convertWorkingDaysToDays(-7));
|
assertEquals(Arrays.asList(-11), instance.convertWorkingDaysToDays(-7));
|
||||||
assertEquals(Arrays.asList(-8, -9, -10), instance.convertWorkingDaysToDays(-6));
|
assertEquals(Arrays.asList(-8, -9, -10), instance.convertWorkingDaysToDays(-6));
|
||||||
assertEquals(Arrays.asList(-7), instance.convertWorkingDaysToDays(-5));
|
assertEquals(Arrays.asList(-7), instance.convertWorkingDaysToDays(-5));
|
||||||
assertEquals(Arrays.asList(-6), instance.convertWorkingDaysToDays(-4));
|
assertEquals(Arrays.asList(-6), instance.convertWorkingDaysToDays(-4));
|
||||||
assertEquals(Arrays.asList(-5), instance.convertWorkingDaysToDays(-3));
|
assertEquals(Arrays.asList(-5), instance.convertWorkingDaysToDays(-3));
|
||||||
assertEquals(Arrays.asList(-4), instance.convertWorkingDaysToDays(-2));
|
assertEquals(Arrays.asList(-4), instance.convertWorkingDaysToDays(-2));
|
||||||
assertEquals(Arrays.asList(-1, -2, -3), instance.convertWorkingDaysToDays(-1));
|
assertEquals(Arrays.asList(-1, -2, -3), instance.convertWorkingDaysToDays(-1));
|
||||||
assertEquals(Arrays.asList(0), instance.convertWorkingDaysToDays(0));
|
assertEquals(Arrays.asList(0), instance.convertWorkingDaysToDays(0));
|
||||||
assertEquals(Arrays.asList(1), instance.convertWorkingDaysToDays(1));
|
assertEquals(Arrays.asList(1), instance.convertWorkingDaysToDays(1));
|
||||||
assertEquals(Arrays.asList(2), instance.convertWorkingDaysToDays(2));
|
assertEquals(Arrays.asList(2), instance.convertWorkingDaysToDays(2));
|
||||||
assertEquals(Arrays.asList(3, 4, 5), instance.convertWorkingDaysToDays(3));
|
assertEquals(Arrays.asList(3, 4, 5), instance.convertWorkingDaysToDays(3));
|
||||||
assertEquals(Arrays.asList(6), instance.convertWorkingDaysToDays(4));
|
assertEquals(Arrays.asList(6), instance.convertWorkingDaysToDays(4));
|
||||||
assertEquals(Arrays.asList(7), instance.convertWorkingDaysToDays(5));
|
assertEquals(Arrays.asList(7), instance.convertWorkingDaysToDays(5));
|
||||||
assertEquals(Arrays.asList(8), instance.convertWorkingDaysToDays(6));
|
assertEquals(Arrays.asList(8), instance.convertWorkingDaysToDays(6));
|
||||||
assertEquals(Arrays.asList(9), instance.convertWorkingDaysToDays(7));
|
assertEquals(Arrays.asList(9), instance.convertWorkingDaysToDays(7));
|
||||||
assertEquals(Arrays.asList(10, 11, 12), instance.convertWorkingDaysToDays(8));
|
assertEquals(Arrays.asList(10, 11, 12), instance.convertWorkingDaysToDays(8));
|
||||||
assertEquals(Arrays.asList(13), instance.convertWorkingDaysToDays(9));
|
assertEquals(Arrays.asList(13), instance.convertWorkingDaysToDays(9));
|
||||||
assertEquals(Arrays.asList(14), instance.convertWorkingDaysToDays(10));
|
assertEquals(Arrays.asList(14), instance.convertWorkingDaysToDays(10));
|
||||||
assertEquals(Arrays.asList(15), instance.convertWorkingDaysToDays(11));
|
assertEquals(Arrays.asList(15), instance.convertWorkingDaysToDays(11));
|
||||||
|
|
||||||
assertEquals(Arrays.asList(12), instance.convertWorkingDaysToDays(12));
|
assertEquals(Arrays.asList(12), instance.convertWorkingDaysToDays(12));
|
||||||
assertEquals(Arrays.asList(13), instance.convertWorkingDaysToDays(13));
|
assertEquals(Arrays.asList(13), instance.convertWorkingDaysToDays(13));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConvertWorkingDaysToDaysAtWeekend() throws InvalidArgumentException {
|
public void testConvertWorkingDaysToDaysAtWeekend() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-03-10T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-03-10T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(Arrays.asList(-13), instance.convertWorkingDaysToDays(-13));
|
assertEquals(Arrays.asList(-13), instance.convertWorkingDaysToDays(-13));
|
||||||
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-12));
|
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-12));
|
||||||
|
|
||||||
assertEquals(Arrays.asList(-10), instance.convertWorkingDaysToDays(-8));
|
assertEquals(Arrays.asList(-10), instance.convertWorkingDaysToDays(-8));
|
||||||
assertEquals(Arrays.asList(-9), instance.convertWorkingDaysToDays(-7));
|
assertEquals(Arrays.asList(-9), instance.convertWorkingDaysToDays(-7));
|
||||||
assertEquals(Arrays.asList(-8), instance.convertWorkingDaysToDays(-6));
|
assertEquals(Arrays.asList(-8), instance.convertWorkingDaysToDays(-6));
|
||||||
assertEquals(Arrays.asList(-5, -6, -7), instance.convertWorkingDaysToDays(-5));
|
assertEquals(Arrays.asList(-5, -6, -7), instance.convertWorkingDaysToDays(-5));
|
||||||
assertEquals(Arrays.asList(-4), instance.convertWorkingDaysToDays(-4));
|
assertEquals(Arrays.asList(-4), instance.convertWorkingDaysToDays(-4));
|
||||||
assertEquals(Arrays.asList(-3), instance.convertWorkingDaysToDays(-3));
|
assertEquals(Arrays.asList(-3), instance.convertWorkingDaysToDays(-3));
|
||||||
assertEquals(Arrays.asList(-2), instance.convertWorkingDaysToDays(-2));
|
assertEquals(Arrays.asList(-2), instance.convertWorkingDaysToDays(-2));
|
||||||
assertEquals(Arrays.asList(-1), instance.convertWorkingDaysToDays(-1));
|
assertEquals(Arrays.asList(-1), instance.convertWorkingDaysToDays(-1));
|
||||||
assertEquals(Arrays.asList(0, 1), instance.convertWorkingDaysToDays(0));
|
assertEquals(Arrays.asList(0, 1), instance.convertWorkingDaysToDays(0));
|
||||||
assertEquals(Arrays.asList(2), instance.convertWorkingDaysToDays(1));
|
assertEquals(Arrays.asList(2), instance.convertWorkingDaysToDays(1));
|
||||||
assertEquals(Arrays.asList(3), instance.convertWorkingDaysToDays(2));
|
assertEquals(Arrays.asList(3), instance.convertWorkingDaysToDays(2));
|
||||||
assertEquals(Arrays.asList(4), instance.convertWorkingDaysToDays(3));
|
assertEquals(Arrays.asList(4), instance.convertWorkingDaysToDays(3));
|
||||||
assertEquals(Arrays.asList(5), instance.convertWorkingDaysToDays(4));
|
assertEquals(Arrays.asList(5), instance.convertWorkingDaysToDays(4));
|
||||||
assertEquals(Arrays.asList(6, 7, 8), instance.convertWorkingDaysToDays(5));
|
assertEquals(Arrays.asList(6, 7, 8), instance.convertWorkingDaysToDays(5));
|
||||||
assertEquals(Arrays.asList(9), instance.convertWorkingDaysToDays(6));
|
assertEquals(Arrays.asList(9), instance.convertWorkingDaysToDays(6));
|
||||||
assertEquals(Arrays.asList(10), instance.convertWorkingDaysToDays(7));
|
assertEquals(Arrays.asList(10), instance.convertWorkingDaysToDays(7));
|
||||||
assertEquals(Arrays.asList(11), instance.convertWorkingDaysToDays(8));
|
assertEquals(Arrays.asList(11), instance.convertWorkingDaysToDays(8));
|
||||||
assertEquals(Arrays.asList(12), instance.convertWorkingDaysToDays(9));
|
assertEquals(Arrays.asList(12), instance.convertWorkingDaysToDays(9));
|
||||||
assertEquals(Arrays.asList(13, 14, 15), instance.convertWorkingDaysToDays(10));
|
assertEquals(Arrays.asList(13, 14, 15), instance.convertWorkingDaysToDays(10));
|
||||||
assertEquals(Arrays.asList(16), instance.convertWorkingDaysToDays(11));
|
assertEquals(Arrays.asList(16), instance.convertWorkingDaysToDays(11));
|
||||||
|
|
||||||
assertEquals(Arrays.asList(12), instance.convertWorkingDaysToDays(12));
|
assertEquals(Arrays.asList(12), instance.convertWorkingDaysToDays(12));
|
||||||
assertEquals(Arrays.asList(13), instance.convertWorkingDaysToDays(13));
|
assertEquals(Arrays.asList(13), instance.convertWorkingDaysToDays(13));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConvertWorkingDaysToDaysOnEasterSunday() throws InvalidArgumentException {
|
public void testConvertWorkingDaysToDaysOnEasterSunday() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-04-01T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-04-01T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(Arrays.asList(-13), instance.convertWorkingDaysToDays(-13));
|
assertEquals(Arrays.asList(-13), instance.convertWorkingDaysToDays(-13));
|
||||||
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-12));
|
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-12));
|
||||||
|
|
||||||
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-8));
|
assertEquals(Arrays.asList(-12), instance.convertWorkingDaysToDays(-8));
|
||||||
assertEquals(Arrays.asList(-11), instance.convertWorkingDaysToDays(-7));
|
assertEquals(Arrays.asList(-11), instance.convertWorkingDaysToDays(-7));
|
||||||
assertEquals(Arrays.asList(-10), instance.convertWorkingDaysToDays(-6));
|
assertEquals(Arrays.asList(-10), instance.convertWorkingDaysToDays(-6));
|
||||||
assertEquals(Arrays.asList(-9), instance.convertWorkingDaysToDays(-5));
|
assertEquals(Arrays.asList(-9), instance.convertWorkingDaysToDays(-5));
|
||||||
assertEquals(Arrays.asList(-6, -7, -8), instance.convertWorkingDaysToDays(-4));
|
assertEquals(Arrays.asList(-6, -7, -8), instance.convertWorkingDaysToDays(-4));
|
||||||
assertEquals(Arrays.asList(-5), instance.convertWorkingDaysToDays(-3));
|
assertEquals(Arrays.asList(-5), instance.convertWorkingDaysToDays(-3));
|
||||||
assertEquals(Arrays.asList(-4), instance.convertWorkingDaysToDays(-2));
|
assertEquals(Arrays.asList(-4), instance.convertWorkingDaysToDays(-2));
|
||||||
assertEquals(Arrays.asList(-3), instance.convertWorkingDaysToDays(-1));
|
assertEquals(Arrays.asList(-3), instance.convertWorkingDaysToDays(-1));
|
||||||
assertEquals(Arrays.asList(0, 1, -1, -2), instance.convertWorkingDaysToDays(0));
|
assertEquals(Arrays.asList(0, 1, -1, -2), instance.convertWorkingDaysToDays(0));
|
||||||
assertEquals(Arrays.asList(2), instance.convertWorkingDaysToDays(1));
|
assertEquals(Arrays.asList(2), instance.convertWorkingDaysToDays(1));
|
||||||
assertEquals(Arrays.asList(3), instance.convertWorkingDaysToDays(2));
|
assertEquals(Arrays.asList(3), instance.convertWorkingDaysToDays(2));
|
||||||
assertEquals(Arrays.asList(4), instance.convertWorkingDaysToDays(3));
|
assertEquals(Arrays.asList(4), instance.convertWorkingDaysToDays(3));
|
||||||
assertEquals(Arrays.asList(5, 6, 7), instance.convertWorkingDaysToDays(4));
|
assertEquals(Arrays.asList(5, 6, 7), instance.convertWorkingDaysToDays(4));
|
||||||
assertEquals(Arrays.asList(8), instance.convertWorkingDaysToDays(5));
|
assertEquals(Arrays.asList(8), instance.convertWorkingDaysToDays(5));
|
||||||
assertEquals(Arrays.asList(9), instance.convertWorkingDaysToDays(6));
|
assertEquals(Arrays.asList(9), instance.convertWorkingDaysToDays(6));
|
||||||
assertEquals(Arrays.asList(10), instance.convertWorkingDaysToDays(7));
|
assertEquals(Arrays.asList(10), instance.convertWorkingDaysToDays(7));
|
||||||
assertEquals(Arrays.asList(11), instance.convertWorkingDaysToDays(8));
|
assertEquals(Arrays.asList(11), instance.convertWorkingDaysToDays(8));
|
||||||
assertEquals(Arrays.asList(12, 13, 14), instance.convertWorkingDaysToDays(9));
|
assertEquals(Arrays.asList(12, 13, 14), instance.convertWorkingDaysToDays(9));
|
||||||
assertEquals(Arrays.asList(15), instance.convertWorkingDaysToDays(10));
|
assertEquals(Arrays.asList(15), instance.convertWorkingDaysToDays(10));
|
||||||
assertEquals(Arrays.asList(16), instance.convertWorkingDaysToDays(11));
|
assertEquals(Arrays.asList(16), instance.convertWorkingDaysToDays(11));
|
||||||
|
|
||||||
assertEquals(Arrays.asList(12), instance.convertWorkingDaysToDays(12));
|
assertEquals(Arrays.asList(12), instance.convertWorkingDaysToDays(12));
|
||||||
assertEquals(Arrays.asList(13), instance.convertWorkingDaysToDays(13));
|
assertEquals(Arrays.asList(13), instance.convertWorkingDaysToDays(13));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEasterHolidays() throws InvalidArgumentException {
|
public void testEasterHolidays() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-03-28T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-03-28T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(2));
|
assertEquals(1, instance.convertDaysToWorkingDays(2));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(3));
|
assertEquals(1, instance.convertDaysToWorkingDays(3));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(4));
|
assertEquals(1, instance.convertDaysToWorkingDays(4));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(5));
|
assertEquals(1, instance.convertDaysToWorkingDays(5));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(6));
|
assertEquals(2, instance.convertDaysToWorkingDays(6));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWhitsunHolidays() throws InvalidArgumentException {
|
public void testWhitsunHolidays() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-05-16T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-05-16T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(2));
|
assertEquals(2, instance.convertDaysToWorkingDays(2));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(3));
|
assertEquals(2, instance.convertDaysToWorkingDays(3));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(4));
|
assertEquals(2, instance.convertDaysToWorkingDays(4));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(5));
|
assertEquals(2, instance.convertDaysToWorkingDays(5));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(6));
|
assertEquals(3, instance.convertDaysToWorkingDays(6));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLabourDayHoliday() throws InvalidArgumentException {
|
public void testLabourDayHoliday() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-04-26T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-04-26T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(2));
|
assertEquals(1, instance.convertDaysToWorkingDays(2));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(3));
|
assertEquals(1, instance.convertDaysToWorkingDays(3));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(4));
|
assertEquals(2, instance.convertDaysToWorkingDays(4));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(5));
|
assertEquals(2, instance.convertDaysToWorkingDays(5));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(6));
|
assertEquals(3, instance.convertDaysToWorkingDays(6));
|
||||||
assertEquals(4, instance.convertDaysToWorkingDays(7));
|
assertEquals(4, instance.convertDaysToWorkingDays(7));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAscensionDayHoliday() throws InvalidArgumentException {
|
public void testAscensionDayHoliday() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-05-07T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-05-07T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(2));
|
assertEquals(2, instance.convertDaysToWorkingDays(2));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(3));
|
assertEquals(2, instance.convertDaysToWorkingDays(3));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(4));
|
assertEquals(3, instance.convertDaysToWorkingDays(4));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(5));
|
assertEquals(3, instance.convertDaysToWorkingDays(5));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(6));
|
assertEquals(3, instance.convertDaysToWorkingDays(6));
|
||||||
assertEquals(4, instance.convertDaysToWorkingDays(7));
|
assertEquals(4, instance.convertDaysToWorkingDays(7));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDayOfGermanUnityHoliday() throws InvalidArgumentException {
|
public void testDayOfGermanUnityHoliday() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-10-01T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-10-01T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(2));
|
assertEquals(1, instance.convertDaysToWorkingDays(2));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(3));
|
assertEquals(2, instance.convertDaysToWorkingDays(3));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(4));
|
assertEquals(3, instance.convertDaysToWorkingDays(4));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(5));
|
assertEquals(3, instance.convertDaysToWorkingDays(5));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(6));
|
assertEquals(3, instance.convertDaysToWorkingDays(6));
|
||||||
assertEquals(4, instance.convertDaysToWorkingDays(7));
|
assertEquals(4, instance.convertDaysToWorkingDays(7));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testChristmasAndNewYearHolidays() throws InvalidArgumentException {
|
public void testChristmasAndNewYearHolidays() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-12-20T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-12-20T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
assertEquals(1, instance.convertDaysToWorkingDays(1));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(2));
|
assertEquals(1, instance.convertDaysToWorkingDays(2));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(3));
|
assertEquals(1, instance.convertDaysToWorkingDays(3));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(4));
|
assertEquals(2, instance.convertDaysToWorkingDays(4));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(5));
|
assertEquals(2, instance.convertDaysToWorkingDays(5));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(6));
|
assertEquals(2, instance.convertDaysToWorkingDays(6));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(7));
|
assertEquals(3, instance.convertDaysToWorkingDays(7));
|
||||||
assertEquals(4, instance.convertDaysToWorkingDays(8));
|
assertEquals(4, instance.convertDaysToWorkingDays(8));
|
||||||
assertEquals(4, instance.convertDaysToWorkingDays(9));
|
assertEquals(4, instance.convertDaysToWorkingDays(9));
|
||||||
assertEquals(4, instance.convertDaysToWorkingDays(10));
|
assertEquals(4, instance.convertDaysToWorkingDays(10));
|
||||||
assertEquals(5, instance.convertDaysToWorkingDays(11));
|
assertEquals(5, instance.convertDaysToWorkingDays(11));
|
||||||
assertEquals(5, instance.convertDaysToWorkingDays(12));
|
assertEquals(5, instance.convertDaysToWorkingDays(12));
|
||||||
assertEquals(6, instance.convertDaysToWorkingDays(13));
|
assertEquals(6, instance.convertDaysToWorkingDays(13));
|
||||||
assertEquals(7, instance.convertDaysToWorkingDays(14));
|
assertEquals(7, instance.convertDaysToWorkingDays(14));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCustomHolidaysWithDayOfReformationAndAllSaintsDay() throws InvalidArgumentException {
|
public void testCustomHolidaysWithDayOfReformationAndAllSaintsDay() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-10-26T00:00:00.000Z"));
|
.initialize(getLargeListOfColumnHeaders(), Instant.parse("2018-10-26T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
assertEquals(0, instance.convertDaysToWorkingDays(0));
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(1));
|
assertEquals(0, instance.convertDaysToWorkingDays(1));
|
||||||
assertEquals(0, instance.convertDaysToWorkingDays(2));
|
assertEquals(0, instance.convertDaysToWorkingDays(2));
|
||||||
assertEquals(1, instance.convertDaysToWorkingDays(3));
|
assertEquals(1, instance.convertDaysToWorkingDays(3));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(4));
|
assertEquals(2, instance.convertDaysToWorkingDays(4));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(5));
|
assertEquals(2, instance.convertDaysToWorkingDays(5));
|
||||||
assertEquals(2, instance.convertDaysToWorkingDays(6));
|
assertEquals(2, instance.convertDaysToWorkingDays(6));
|
||||||
assertEquals(3, instance.convertDaysToWorkingDays(7));
|
assertEquals(3, instance.convertDaysToWorkingDays(7));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetEasterSunday() throws InvalidArgumentException {
|
public void testGetEasterSunday() throws InvalidArgumentException {
|
||||||
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
DaysToWorkingDaysConverter instance = DaysToWorkingDaysConverter
|
||||||
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-27T00:00:00.000Z"));
|
.initialize(getShortListOfColumnHeaders(), Instant.parse("2018-02-27T00:00:00.000Z"));
|
||||||
|
|
||||||
assertEquals(LocalDate.of(2018, 4, 1), instance.getEasterSunday(2018));
|
assertEquals(LocalDate.of(2018, 4, 1), instance.getEasterSunday(2018));
|
||||||
assertEquals(LocalDate.of(2019, 4, 21), instance.getEasterSunday(2019));
|
assertEquals(LocalDate.of(2019, 4, 21), instance.getEasterSunday(2019));
|
||||||
assertEquals(LocalDate.of(2020, 4, 12), instance.getEasterSunday(2020));
|
assertEquals(LocalDate.of(2020, 4, 12), instance.getEasterSunday(2020));
|
||||||
assertEquals(LocalDate.of(2021, 4, 4), instance.getEasterSunday(2021));
|
assertEquals(LocalDate.of(2021, 4, 4), instance.getEasterSunday(2021));
|
||||||
assertEquals(LocalDate.of(2022, 4, 17), instance.getEasterSunday(2022));
|
assertEquals(LocalDate.of(2022, 4, 17), instance.getEasterSunday(2022));
|
||||||
assertEquals(LocalDate.of(2023, 4, 9), instance.getEasterSunday(2023));
|
assertEquals(LocalDate.of(2023, 4, 9), instance.getEasterSunday(2023));
|
||||||
assertEquals(LocalDate.of(2024, 3, 31), instance.getEasterSunday(2024));
|
assertEquals(LocalDate.of(2024, 3, 31), instance.getEasterSunday(2024));
|
||||||
assertEquals(LocalDate.of(2025, 4, 20), instance.getEasterSunday(2025));
|
assertEquals(LocalDate.of(2025, 4, 20), instance.getEasterSunday(2025));
|
||||||
assertEquals(LocalDate.of(2026, 4, 5), instance.getEasterSunday(2026));
|
assertEquals(LocalDate.of(2026, 4, 5), instance.getEasterSunday(2026));
|
||||||
assertEquals(LocalDate.of(2027, 3, 28), instance.getEasterSunday(2027));
|
assertEquals(LocalDate.of(2027, 3, 28), instance.getEasterSunday(2027));
|
||||||
assertEquals(LocalDate.of(2028, 4, 16), instance.getEasterSunday(2028));
|
assertEquals(LocalDate.of(2028, 4, 16), instance.getEasterSunday(2028));
|
||||||
assertEquals(LocalDate.of(2029, 4, 1), instance.getEasterSunday(2029));
|
assertEquals(LocalDate.of(2029, 4, 1), instance.getEasterSunday(2029));
|
||||||
assertEquals(LocalDate.of(2030, 4, 21), instance.getEasterSunday(2030));
|
assertEquals(LocalDate.of(2030, 4, 21), instance.getEasterSunday(2030));
|
||||||
assertEquals(LocalDate.of(2031, 4, 13), instance.getEasterSunday(2031));
|
assertEquals(LocalDate.of(2031, 4, 13), instance.getEasterSunday(2031));
|
||||||
assertEquals(LocalDate.of(2032, 3, 28), instance.getEasterSunday(2032));
|
assertEquals(LocalDate.of(2032, 3, 28), instance.getEasterSunday(2032));
|
||||||
assertEquals(LocalDate.of(2033, 4, 17), instance.getEasterSunday(2033));
|
assertEquals(LocalDate.of(2033, 4, 17), instance.getEasterSunday(2033));
|
||||||
assertEquals(LocalDate.of(2034, 4, 9), instance.getEasterSunday(2034));
|
assertEquals(LocalDate.of(2034, 4, 9), instance.getEasterSunday(2034));
|
||||||
assertEquals(LocalDate.of(2035, 3, 25), instance.getEasterSunday(2035));
|
assertEquals(LocalDate.of(2035, 3, 25), instance.getEasterSunday(2035));
|
||||||
assertEquals(LocalDate.of(2040, 4, 1), instance.getEasterSunday(2040));
|
assertEquals(LocalDate.of(2040, 4, 1), instance.getEasterSunday(2040));
|
||||||
assertEquals(LocalDate.of(2050, 4, 10), instance.getEasterSunday(2050));
|
assertEquals(LocalDate.of(2050, 4, 10), instance.getEasterSunday(2050));
|
||||||
assertEquals(LocalDate.of(2100, 3, 28), instance.getEasterSunday(2100));
|
assertEquals(LocalDate.of(2100, 3, 28), instance.getEasterSunday(2100));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getShortListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -3));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -3));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-1, -2));
|
columnHeaders.add(new TimeIntervalColumnHeader(-1, -2));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1, 2));
|
columnHeaders.add(new TimeIntervalColumnHeader(1, 2));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(3, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(3, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TimeIntervalColumnHeader> getLargeListOfColumnHeaders() {
|
private List<TimeIntervalColumnHeader> getLargeListOfColumnHeaders() {
|
||||||
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
columnHeaders.add(new TimeIntervalColumnHeader(-1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
columnHeaders.add(new TimeIntervalColumnHeader(0));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
columnHeaders.add(new TimeIntervalColumnHeader(1));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
|
||||||
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
|
||||||
return columnHeaders;
|
return columnHeaders;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,83 +1,83 @@
|
||||||
package pro.taskana.security;
|
package pro.taskana.security;
|
||||||
|
|
||||||
import java.security.Principal;
|
import java.security.Principal;
|
||||||
import java.security.PrivilegedActionException;
|
import java.security.PrivilegedActionException;
|
||||||
import java.security.PrivilegedExceptionAction;
|
import java.security.PrivilegedExceptionAction;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.security.auth.Subject;
|
import javax.security.auth.Subject;
|
||||||
|
|
||||||
import org.junit.runners.BlockJUnit4ClassRunner;
|
import org.junit.runners.BlockJUnit4ClassRunner;
|
||||||
import org.junit.runners.model.FrameworkMethod;
|
import org.junit.runners.model.FrameworkMethod;
|
||||||
import org.junit.runners.model.InitializationError;
|
import org.junit.runners.model.InitializationError;
|
||||||
import org.junit.runners.model.Statement;
|
import org.junit.runners.model.Statement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runner for integration tests that enables JAAS subject.
|
* Runner for integration tests that enables JAAS subject.
|
||||||
*/
|
*/
|
||||||
public class JAASRunner extends BlockJUnit4ClassRunner {
|
public class JAASRunner extends BlockJUnit4ClassRunner {
|
||||||
|
|
||||||
public JAASRunner(Class<?> c) throws InitializationError {
|
public JAASRunner(Class<?> c) throws InitializationError {
|
||||||
super(c);
|
super(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Statement methodInvoker(FrameworkMethod method, Object test) {
|
protected Statement methodInvoker(FrameworkMethod method, Object test) {
|
||||||
|
|
||||||
Subject subject = new Subject();
|
Subject subject = new Subject();
|
||||||
List<Principal> principalList = new ArrayList<>();
|
List<Principal> principalList = new ArrayList<>();
|
||||||
|
|
||||||
if (test != null) {
|
if (test != null) {
|
||||||
WithAccessId withAccessId = method.getMethod().getAnnotation(WithAccessId.class);
|
WithAccessId withAccessId = method.getMethod().getAnnotation(WithAccessId.class);
|
||||||
if (withAccessId != null) {
|
if (withAccessId != null) {
|
||||||
if (withAccessId.userName() != null) {
|
if (withAccessId.userName() != null) {
|
||||||
principalList.add(new UserPrincipal(withAccessId.userName()));
|
principalList.add(new UserPrincipal(withAccessId.userName()));
|
||||||
}
|
}
|
||||||
for (String groupName : withAccessId.groupNames()) {
|
for (String groupName : withAccessId.groupNames()) {
|
||||||
if (groupName != null) {
|
if (groupName != null) {
|
||||||
principalList.add(new GroupPrincipal(groupName));
|
principalList.add(new GroupPrincipal(groupName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
subject.getPrincipals().addAll(principalList);
|
subject.getPrincipals().addAll(principalList);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Statement base = super.methodInvoker(method, test);
|
final Statement base = super.methodInvoker(method, test);
|
||||||
return new Statement() {
|
return new Statement() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void evaluate() throws Throwable {
|
public void evaluate() throws Throwable {
|
||||||
try {
|
try {
|
||||||
Subject.doAs(subject, new PrivilegedExceptionAction<Object>() {
|
Subject.doAs(subject, new PrivilegedExceptionAction<Object>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object run() throws Exception {
|
public Object run() throws Exception {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
base.evaluate();
|
base.evaluate();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
throw new Exception(e);
|
throw new Exception(e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (PrivilegedActionException e) {
|
} catch (PrivilegedActionException e) {
|
||||||
Throwable cause = e.getCause();
|
Throwable cause = e.getCause();
|
||||||
Throwable nestedCause = null;
|
Throwable nestedCause = null;
|
||||||
if (cause != null) {
|
if (cause != null) {
|
||||||
nestedCause = cause.getCause();
|
nestedCause = cause.getCause();
|
||||||
}
|
}
|
||||||
if (nestedCause != null) {
|
if (nestedCause != null) {
|
||||||
throw nestedCause;
|
throw nestedCause;
|
||||||
} else if (cause != null) {
|
} else if (cause != null) {
|
||||||
throw cause;
|
throw cause;
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,81 +1,81 @@
|
||||||
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2 , ORG_LEVEL_3 , ORG_LEVEL_4 );
|
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2 , ORG_LEVEL_3 , ORG_LEVEL_4 );
|
||||||
INSERT INTO TASKANA.WORKBASKET VALUES ('WBI:000000000000000000000000000000000001', 'USER_1_1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'PPK User 1 KSC 1', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 1', 'John' , '' , '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.WORKBASKET VALUES ('WBI:000000000000000000000000000000000001', 'USER_1_1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'PPK User 1 KSC 1', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 1', 'John' , '' , '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.WORKBASKET VALUES ('WBI:000000000000000000000000000000000002', 'USER_1_2', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'PPK User 1 KSC 2', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 2', 'John' , '' , '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.WORKBASKET VALUES ('WBI:000000000000000000000000000000000002', 'USER_1_2', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'PPK User 1 KSC 2', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 2', 'John' , '' , '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.WORKBASKET VALUES ('WBI:000000000000000000000000000000000003', 'USER_1_3', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'PPK User 1 KSC 3', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 3', 'John' , '' , '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.WORKBASKET VALUES ('WBI:000000000000000000000000000000000003', 'USER_1_3', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'PPK User 1 KSC 3', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 3', 'John' , '' , '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.WORKBASKET VALUES ('WBI:000000000000000000000000000000000004', 'USER_1_4', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'PPK User 1 KSC 4', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 4', 'John' , '' , '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.WORKBASKET VALUES ('WBI:000000000000000000000000000000000004', 'USER_1_4', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'PPK User 1 KSC 4', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 4', 'John' , '' , '' , '' , '' , '' , '' , '' , '' );
|
||||||
|
|
||||||
-- CLASSIFICATION TABLE (ID , KEY , PARENT_ID , CATEGORY , TYPE , DOMAIN , VALID_IN_DOMAIN, CREATED , MODIFIED ,NAME , DESCRIPTION , PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1 , CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 );
|
-- CLASSIFICATION TABLE (ID , KEY , PARENT_ID , CATEGORY , TYPE , DOMAIN , VALID_IN_DOMAIN, CREATED , MODIFIED ,NAME , DESCRIPTION , PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1 , CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 );
|
||||||
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '' , 'EXTERN' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'OLD-Leistungsfall' , 'OLD-Leistungsfall' , 3 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '' , 'EXTERN' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'OLD-Leistungsfall' , 'OLD-Leistungsfall' , 3 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000002', 'L20000', 'CLI:000000000000000000000000000000000001' , 'EXTERN' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Beratungsprotokoll' , 'Beratungsprotokoll', 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR, ANR', '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000002', 'L20000', 'CLI:000000000000000000000000000000000001' , 'EXTERN' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Beratungsprotokoll' , 'Beratungsprotokoll', 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR, ANR', '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000003', 'L30000', 'CLI:000000000000000000000000000000000001' , 'AUTOMATIC', 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Widerruf' , 'Widerruf' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000003', 'L30000', 'CLI:000000000000000000000000000000000001' , 'AUTOMATIC', 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Widerruf' , 'Widerruf' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000004', 'L40000', 'CLI:000000000000000000000000000000000001' , 'MANUAL' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamikaenderung' , 'Dynamikaenderung' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000004', 'L40000', 'CLI:000000000000000000000000000000000001' , 'MANUAL' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamikaenderung' , 'Dynamikaenderung' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000005', 'L50000', 'CLI:000000000000000000000000000000000001' , 'EXTERN' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung' , 'Dynamik-Ablehnung' , 5 , 'P5D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000005', 'L50000', 'CLI:000000000000000000000000000000000001' , 'EXTERN' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung' , 'Dynamik-Ablehnung' , 5 , 'P5D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000006', 'L11000', '' , 'Anhang' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Anhang 1' , 'Anhang 1' , 3 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000006', 'L11000', '' , 'Anhang' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Anhang 1' , 'Anhang 1' , 3 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000007', 'L22000', '' , 'Anhang' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Anhang 2' , 'Anhang 2' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR, ANR', '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000007', 'L22000', '' , 'Anhang' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Anhang 2' , 'Anhang 2' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR, ANR', '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000008', 'L33000', '' , 'Anhang' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Anhang 3' , 'Anhang 3' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR, ANR', '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000008', 'L33000', '' , 'Anhang' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Anhang 3' , 'Anhang 3' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR, ANR', '' , '' , '' , '' , '' , '' , '' );
|
||||||
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000009', 'L99000', '' , 'Anhang' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Anhang 9' , 'Anhang 9' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR, ANR', '' , '' , '' , '' , '' , '' , '' );
|
INSERT INTO TASKANA.CLASSIFICATION VALUES('CLI:000000000000000000000000000000000009', 'L99000', '' , 'Anhang' , 'TASK', 'DOMAIN_A', TRUE , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Anhang 9' , 'Anhang 9' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR, ANR', '' , '' , '' , '' , '' , '' , '' );
|
||||||
|
|
||||||
-- ATTACHMENT TABLE (ID , TASK_ID , CREATED , MODIFIED , CLASSIFICATION_KEY,CLASSIFICATION_ID , REF_COMPANY, REF_SYSTEM, REF_INSTANCE, REF_TYPE, REF_VALUE, CHANNEL, RECEIVED , CUSTOM_ATTRIBUTES );
|
-- ATTACHMENT TABLE (ID , TASK_ID , CREATED , MODIFIED , CLASSIFICATION_KEY,CLASSIFICATION_ID , REF_COMPANY, REF_SYSTEM, REF_INSTANCE, REF_TYPE, REF_VALUE, CHANNEL, RECEIVED , CUSTOM_ATTRIBUTES );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000001', 'TKI:000000000000000000000000000000000001', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L11000' ,'CLI:000000000000000000000000000000000006', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000001', 'TKI:000000000000000000000000000000000001', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L11000' ,'CLI:000000000000000000000000000000000006', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000002', 'TKI:000000000000000000000000000000000013', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L11000' ,'CLI:000000000000000000000000000000000006', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000002', 'TKI:000000000000000000000000000000000013', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L11000' ,'CLI:000000000000000000000000000000000006', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000003', 'TKI:000000000000000000000000000000000014', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L22000' ,'CLI:000000000000000000000000000000000007', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000003', 'TKI:000000000000000000000000000000000014', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L22000' ,'CLI:000000000000000000000000000000000007', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000004', 'TKI:000000000000000000000000000000000024', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L22000' ,'CLI:000000000000000000000000000000000007', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000004', 'TKI:000000000000000000000000000000000024', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L22000' ,'CLI:000000000000000000000000000000000007', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000005', 'TKI:000000000000000000000000000000000025', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L33000' ,'CLI:000000000000000000000000000000000008', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000005', 'TKI:000000000000000000000000000000000025', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L33000' ,'CLI:000000000000000000000000000000000008', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000006', 'TKI:000000000000000000000000000000000033', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L11000' ,'CLI:000000000000000000000000000000000006', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000006', 'TKI:000000000000000000000000000000000033', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L11000' ,'CLI:000000000000000000000000000000000006', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000007', 'TKI:000000000000000000000000000000000034', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L22000' ,'CLI:000000000000000000000000000000000007', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000007', 'TKI:000000000000000000000000000000000034', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L22000' ,'CLI:000000000000000000000000000000000007', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000008', 'TKI:000000000000000000000000000000000035', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L22000' ,'CLI:000000000000000000000000000000000007', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000008', 'TKI:000000000000000000000000000000000035', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L22000' ,'CLI:000000000000000000000000000000000007', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000009', 'TKI:000000000000000000000000000000000036', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L33000' ,'CLI:000000000000000000000000000000000008', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000009', 'TKI:000000000000000000000000000000000036', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L33000' ,'CLI:000000000000000000000000000000000008', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000010', 'TKI:000000000000000000000000000000000044', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L33000' ,'CLI:000000000000000000000000000000000008', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000010', 'TKI:000000000000000000000000000000000044', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L33000' ,'CLI:000000000000000000000000000000000008', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000011', 'TKI:000000000000000000000000000000000045', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L99000' ,'CLI:000000000000000000000000000000000009', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
INSERT INTO TASKANA.ATTACHMENT VALUES('ATT:000000000000000000000000000000000011', 'TKI:000000000000000000000000000000000045', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L99000' ,'CLI:000000000000000000000000000000000009', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
|
||||||
|
|
||||||
-- TASK TABLE (ID , CREATED , CLAIMED , COMPLETED , MODIFIED , PLANNED , DUE , NAME , CREATOR , DESCRIPTION , NOTE , PRIORITY, STATE , CLASSIFICATION_CATEGORY , CLASSIFICATION_KEY, CLASSIFICATION_ID , WORKBASKET_ID , WORKBASKET_KEY, DOMAIN , BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, OWNER , POR_COMPANY , POR_SYSTEM , POR_INSTANCE , POR_TYPE , POR_VALUE , IS_READ, IS_TRANSFERRED, CALLBACK_INFO, CUSTOM_ATTRIBUTES, CUSTOM_1 , CUSTOM_2 , CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, CUSTOM_9 ,CUSTOM_10 ,CUSTOM_11 ,CUSTOM_12 ,CUSTOM_13 ,CUSTOM_14 ,CUSTOM_15 ,CUSTOM_16 );
|
-- TASK TABLE (ID , CREATED , CLAIMED , COMPLETED , MODIFIED , PLANNED , DUE , NAME , CREATOR , DESCRIPTION , NOTE , PRIORITY, STATE , CLASSIFICATION_CATEGORY , CLASSIFICATION_KEY, CLASSIFICATION_ID , WORKBASKET_ID , WORKBASKET_KEY, DOMAIN , BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, OWNER , POR_COMPANY , POR_SYSTEM , POR_INSTANCE , POR_TYPE , POR_VALUE , IS_READ, IS_TRANSFERRED, CALLBACK_INFO, CUSTOM_ATTRIBUTES, CUSTOM_1 , CUSTOM_2 , CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, CUSTOM_9 ,CUSTOM_10 ,CUSTOM_11 ,CUSTOM_12 ,CUSTOM_13 ,CUSTOM_14 ,CUSTOM_15 ,CUSTOM_16 );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000001', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task01', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_01' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000001', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task01', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_01' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000002', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task02', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_02' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000002', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task02', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_02' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000003', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task03', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_03' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000003', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task03', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_03' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000004', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task04', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_04' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000004', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task04', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_04' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000005', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task05', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_05' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000005', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task05', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_05' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000006', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task06', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_06' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000006', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task06', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_06' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000007', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task07', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_07' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000007', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task07', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_07' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000008', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task08', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_08' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000008', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task08', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_08' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000009', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task09', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_09' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000009', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task09', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_09' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000010', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task10', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_10' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000010', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task10', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_10' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000011', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task11', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_11' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000011', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task11', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_11' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000012', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task12', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_12' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000012', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task12', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_12' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000013', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task13', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_13' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000013', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task13', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_13' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000014', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task14', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_14' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000014', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task14', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_14' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000015', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task15', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_15' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000015', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task15', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_15' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000016', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task16', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_16' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000016', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task16', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_16' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000017', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task17', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_17' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000017', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task17', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_17' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000018', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task18', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_18' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000018', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task18', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_18' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000019', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task19', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_19' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000019', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task19', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_19' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000020', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task20', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_20' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000020', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task20', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_20' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000021', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task21', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_21' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000021', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task21', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_21' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000022', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task22', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_22' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000022', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task22', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_22' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000023', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task23', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_23' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000023', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task23', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_23' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000024', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task24', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_24' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000024', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task24', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_24' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000025', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task25', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_25' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000025', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task25', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_25' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000026', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task26', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_26' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000026', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task26', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_26' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000027', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task27', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_27' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000027', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task27', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_27' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000028', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task28', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_28' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000028', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task28', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_28' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000029', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task29', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_29' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000029', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task29', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_29' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000030', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task30', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_30' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000030', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task30', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_30' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000031', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task31', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_31' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000031', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task31', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_31' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000032', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task32', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_32' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000032', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task32', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_32' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000033', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task33', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_33' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000033', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task33', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_33' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000034', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task34', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_34' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000034', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task34', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_34' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000035', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task35', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_35' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000035', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task35', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_35' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000036', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task36', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_36' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000036', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task36', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_36' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000037', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task37', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_37' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000037', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task37', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_37' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000038', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task38', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_38' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000038', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task38', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_38' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000039', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task39', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_39' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000039', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task39', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_39' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000040', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task40', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_40' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000040', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task40', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_40' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000041', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task41', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_41' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000041', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task41', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_41' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000042', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task42', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_42' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000042', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task42', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_42' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000043', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task43', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_43' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000043', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task43', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'EXTERN' , 'L50000' , 'CLI:000000000000000000000000000000000005', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_43' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000044', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task44', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_44' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000044', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task44', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_44' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000045', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task45', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_45' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000045', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task45', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_45' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000046', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task46', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_46' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000046', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task46', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_46' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000047', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task47', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_47' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000047', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task47', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_47' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000048', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task48', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_48' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000048', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task48', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_48' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000049', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task49', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_49' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000049', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task49', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_49' );
|
||||||
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000050', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task50', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_50' );
|
INSERT INTO TASKANA.TASK VALUES('TKI:000000000000000000000000000000000050', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, dueDate, 'Task50', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'CLAIMED', 'MANUAL' , 'L40000' , 'CLI:000000000000000000000000000000000004', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_50' );
|
||||||
|
|
|
@ -1,53 +1,53 @@
|
||||||
package pro.taskana.configuration;
|
package pro.taskana.configuration;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import pro.taskana.SpringTaskanaEngineImpl;
|
import pro.taskana.SpringTaskanaEngineImpl;
|
||||||
import pro.taskana.TaskanaEngine;
|
import pro.taskana.TaskanaEngine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class configures the TaskanaEngineConfiguration for spring
|
* This class configures the TaskanaEngineConfiguration for spring
|
||||||
*/
|
*/
|
||||||
public class SpringTaskanaEngineConfiguration extends TaskanaEngineConfiguration {
|
public class SpringTaskanaEngineConfiguration extends TaskanaEngineConfiguration {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(SpringTaskanaEngineConfiguration.class);
|
private static final Logger logger = LoggerFactory.getLogger(SpringTaskanaEngineConfiguration.class);
|
||||||
|
|
||||||
public SpringTaskanaEngineConfiguration(DataSource dataSource, boolean useManagedTransactions,
|
public SpringTaskanaEngineConfiguration(DataSource dataSource, boolean useManagedTransactions,
|
||||||
boolean securityEnabled) throws SQLException {
|
boolean securityEnabled) throws SQLException {
|
||||||
super(dataSource, useManagedTransactions, securityEnabled);
|
super(dataSource, useManagedTransactions, securityEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpringTaskanaEngineConfiguration(DataSource dataSource, boolean useManagedTransactions,
|
public SpringTaskanaEngineConfiguration(DataSource dataSource, boolean useManagedTransactions,
|
||||||
boolean securityEnabled, String propertiesFileName, String propertiesSeparator) throws SQLException {
|
boolean securityEnabled, String propertiesFileName, String propertiesSeparator) throws SQLException {
|
||||||
super(dataSource, useManagedTransactions, securityEnabled, propertiesFileName, propertiesSeparator);
|
super(dataSource, useManagedTransactions, securityEnabled, propertiesFileName, propertiesSeparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method creates the Spring-based TaskanaEngine without an sqlSessionFactory
|
* This method creates the Spring-based TaskanaEngine without an sqlSessionFactory
|
||||||
*
|
*
|
||||||
* @return the TaskanaEngine
|
* @return the TaskanaEngine
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TaskanaEngine buildTaskanaEngine() {
|
public TaskanaEngine buildTaskanaEngine() {
|
||||||
this.useManagedTransactions = true;
|
this.useManagedTransactions = true;
|
||||||
|
|
||||||
dbScriptRunner = new DbSchemaCreator(this.dataSource);
|
dbScriptRunner = new DbSchemaCreator(this.dataSource);
|
||||||
try {
|
try {
|
||||||
dbScriptRunner.run();
|
dbScriptRunner.run();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.error("The taskana schema could not be created: ", e);
|
logger.error("The taskana schema could not be created: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SpringTaskanaEngineImpl(this);
|
return new SpringTaskanaEngineImpl(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDataSource(DataSource dataSource) {
|
public void setDataSource(DataSource dataSource) {
|
||||||
this.dataSource = dataSource;
|
this.dataSource = dataSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue