TSK-1784: throw exception while searching for tasks if only domain but no workbasket key is specified

This commit is contained in:
ryzheboka 2022-01-07 10:42:01 +01:00 committed by Jörg Heffner
parent 2b2fdc3dd9
commit 6e0e273fd3
1 changed files with 9 additions and 2 deletions

View File

@ -2419,11 +2419,18 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
}
if (workbasketKeyIn != null && domain == null) {
throw new InvalidArgumentException("'workbasket-key' requires exactly one domain.");
throw new InvalidArgumentException(
"'workbasket-key' can only be used together with 'domain'.");
}
if (workbasketKeyNotIn != null && domain == null) {
throw new InvalidArgumentException("'workbasket-key-not-in' requires exactly one domain.");
throw new InvalidArgumentException(
"'workbasket-key-not' can only be used together with 'domain'.");
}
if (workbasketKeyIn == null && workbasketKeyNotIn == null && domain != null) {
throw new InvalidArgumentException(
"'domain' can only be used together with 'workbasket-key' or 'workbasket-key-not'.");
}
if (plannedWithin != null && plannedWithin.length % 2 != 0) {