Session session = Environment.getFromCurrent(Session.class);
if (taskDbid!=null) {
TaskImpl task = (TaskImpl) session.get(TaskImpl.class, taskDbid);
if (task==null) {
throw new JbpmException("task "+taskDbid+" was not found");
}
Set<ParticipationImpl> participations = new HashSet<ParticipationImpl>(task.getParticipations());
for (ParticipationImpl participation : participations) {
boolean userMatch = userId!=null ? userId.equals(participation.getUserId()) : false;