use of com.plumdo.flow.rest.task.TaskNextActorResponse in project plumdo-work by wengwh.
the class RestResponseFactory method createTaskNextActorResponse.
public TaskNextActorResponse createTaskNextActorResponse(Task task, List<IdentityLink> identityLinks) {
TaskNextActorResponse taskNextActor = new TaskNextActorResponse();
taskNextActor.setProcessDefinitionId(task.getProcessDefinitionId());
taskNextActor.setTaskDefinitionKey(task.getTaskDefinitionKey());
taskNextActor.setTaskDefinitionName(task.getName());
for (IdentityLink identityLink : identityLinks) {
if (identityLink.getGroupId() != null) {
taskNextActor.addActorInfo(identityLink.getGroupId(), TaskNextActorResponse.TYPE_GROUP, identityLink.getType());
} else if (identityLink.getUserId() != null) {
taskNextActor.addActorInfo(identityLink.getUserId(), TaskNextActorResponse.TYPE_USER, identityLink.getType());
}
}
return taskNextActor;
}
Aggregations