use of org.flowable.engine.task.IdentityLink 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;
}
use of org.flowable.engine.task.IdentityLink in project plumdo-work by wengwh.
the class ProcessDefinitionAuthorizeResource method getAuthorizes.
@RequestMapping(value = "/process-definition/{processDefinitionId}/authorize", method = RequestMethod.GET, produces = "application/json", name = "流程定义授权查询")
public ArrayNode getAuthorizes(@PathVariable String processDefinitionId) {
ProcessDefinition processDefinition = getProcessDefinitionFromRequest(processDefinitionId);
List<IdentityLink> identityLinks = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
ArrayNode arrayNode = objectMapper.createArrayNode();
for (IdentityLink identityLink : identityLinks) {
ObjectNode objectNode = objectMapper.createObjectNode();
if (identityLink.getGroupId() != null) {
objectNode.put("type", ProcessDefinitionAuthorizeRequest.AUTHORIZE_GROUP);
objectNode.put("identityId", identityLink.getGroupId());
} else if (identityLink.getUserId() != null) {
objectNode.put("type", ProcessDefinitionAuthorizeRequest.AUTHORIZE_USER);
objectNode.put("identityId", identityLink.getUserId());
}
arrayNode.add(objectNode);
}
return arrayNode;
}
use of org.flowable.engine.task.IdentityLink in project plumdo-work by wengwh.
the class TaskIdentityResource method getIdentityLinks.
@RequestMapping(value = "/task/{taskId}/identity", method = RequestMethod.GET, produces = "application/json", name = "任务候选人查询")
public List<TaskIdentityResponse> getIdentityLinks(@PathVariable("taskId") String taskId) {
Task task = getTaskFromRequest(taskId, false);
List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(task.getId());
return restResponseFactory.createTaskIdentityResponseList(identityLinks);
}
Aggregations