} else if (ownerTaskUserId != null) {
taskQuery.taskOwner(ownerTaskUserId);
} else if (involvedTaskUserId != null) {
taskQuery.taskInvolvedUser(involvedTaskUserId);
} else if (candidateTaskUserId != null) {
taskQuery.taskCandidateUser(candidateTaskUserId);
} else if (candidateGroupId != null) {
taskQuery.taskCandidateGroup(candidateGroupId);
} else {
throw new ActivitiException("Tasks must be filtered with 'assignee', 'owner', 'involved', 'candidate' or 'candidate-group'");
}