//
// Note: we cant move this code to the TaskEntity (which would be cleaner),
// since the task.delete cascased to all associated identityLinks
// and of course this leads to exception while trying to delete a non-existing identityLink
if (task.getAssignee() != null) {
IdentityLinkEntity identityLink = new IdentityLinkEntity();
identityLink.setUserId(task.getAssignee());
identityLink.setType(IdentityLinkType.ASSIGNEE);
identityLinks.add(identityLink);
}
if (task.getOwner() != null) {
IdentityLinkEntity identityLink = new IdentityLinkEntity();
identityLink.setUserId(task.getOwner());
identityLink.setType(IdentityLinkType.OWNER);
identityLinks.add(identityLink);
}
return (List) task.getIdentityLinks();
}