use of org.flowable.engine.task.Task in project plumdo-work by wengwh.
the class TaskIdentityResource method createIdentityLink.
@RequestMapping(value = "/task/{taskId}/identity", method = RequestMethod.POST, name = "任务候选人创建")
@ResponseStatus(value = HttpStatus.OK)
public void createIdentityLink(@PathVariable("taskId") String taskId, @RequestBody TaskIdentityRequest taskIdentityRequest) {
Task task = getTaskFromRequest(taskId, false);
validateIdentityLinkArguments(taskIdentityRequest.getIdentityId(), taskIdentityRequest.getType());
if (TaskIdentityRequest.AUTHORIZE_GROUP.equals(taskIdentityRequest.getType())) {
taskService.addGroupIdentityLink(task.getId(), taskIdentityRequest.getIdentityId(), IdentityLinkType.CANDIDATE);
} else if (TaskIdentityRequest.AUTHORIZE_USER.equals(taskIdentityRequest.getType())) {
taskService.addUserIdentityLink(task.getId(), taskIdentityRequest.getIdentityId(), IdentityLinkType.CANDIDATE);
}
}
use of org.flowable.engine.task.Task in project plumdo-work by wengwh.
the class TaskClaimResource method claimTask.
@RequestMapping(value = "/task/{taskId}/claim", method = RequestMethod.PUT, name = "任务认领")
@ResponseStatus(value = HttpStatus.OK)
public void claimTask(@PathVariable String taskId, @RequestBody(required = false) TaskActionRequest actionRequest) {
Task task = getTaskFromRequest(taskId, false);
taskService.claim(task.getId(), Authentication.getAuthenticatedUserId());
}
use of org.flowable.engine.task.Task in project plumdo-work by wengwh.
the class TaskHelpResource method helpTask.
@RequestMapping(value = "/task/{taskId}/help/{helper}", method = RequestMethod.PUT, name = "任务协办")
@ResponseStatus(value = HttpStatus.OK)
@Transactional(propagation = Propagation.REQUIRED)
public void helpTask(@PathVariable("taskId") String taskId, @PathVariable("helper") String helper, @RequestBody(required = false) TaskActionRequest actionRequest) {
Task task = getTaskFromRequest(taskId);
if (task.getAssignee() == null) {
taskService.setAssignee(taskId, Authentication.getAuthenticatedUserId());
}
taskService.delegateTask(task.getId(), helper);
// taskExtService.setStartTime(task.getId());
}
use of org.flowable.engine.task.Task in project plumdo-work by wengwh.
the class TaskAssignResource method assignTask.
@RequestMapping(value = "/task/{taskId}/assign/{assignee}", method = RequestMethod.PUT, name = "任务转办")
@ResponseStatus(value = HttpStatus.OK)
public void assignTask(@PathVariable("taskId") String taskId, @PathVariable("assignee") String assignee, @RequestBody(required = false) TaskActionRequest actionRequest) {
Task task = getTaskFromRequest(taskId);
taskService.setAssignee(task.getId(), assignee);
}
use of org.flowable.engine.task.Task 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