hql.append(" as participant ");
appendWhereClause("participant.task = task ", hql);
appendWhereClause("participant.type = 'candidate' ", hql);
IdentitySession identitySession = Environment.getFromCurrent(IdentitySession.class);
List<Group> groups = identitySession.findGroupsByUser(candidate);
if (groups.isEmpty()) {
groupIds = null;
appendWhereClause("participant.userId = :candidateUserId ", hql);
} else {