use of com.plumdo.flow.rest.task.TaskResponse in project plumdo-work by wengwh.
the class TaskReturnResource method returnTask.
@RequestMapping(value = "/task/{taskId}/return", method = RequestMethod.PUT, name = "任务回退")
@ResponseStatus(value = HttpStatus.OK)
@Transactional(propagation = Propagation.REQUIRED)
public List<TaskResponse> returnTask(@PathVariable("taskId") String taskId, @RequestBody(required = false) TaskActionRequest actionRequest) {
List<TaskResponse> responses = new ArrayList<TaskResponse>();
Task task = getTaskFromRequest(taskId);
if (task.getAssignee() == null) {
taskService.setAssignee(taskId, Authentication.getAuthenticatedUserId());
}
/* List<Task> tasks = taskExtService.returnTask(task.getId());
for(Task nextTask : tasks){
TaskExt taskExt = taskExtService.getTaskExtById(nextTask.getId());
responses.add(restResponseFactory.createTaskResponse(taskExt));
}*/
return responses;
}
use of com.plumdo.flow.rest.task.TaskResponse in project plumdo-work by wengwh.
the class RestResponseFactory method createTaskResponse.
public TaskResponse createTaskResponse(Task taskInstance) {
TaskResponse result = new TaskResponse();
createTaskResponse(result, taskInstance);
return result;
}
use of com.plumdo.flow.rest.task.TaskResponse in project plumdo-work by wengwh.
the class TaskRecoverResource method recoverTask.
@RequestMapping(value = "/task/{taskId}/recover", method = RequestMethod.PUT, name = "任务回收")
@ResponseStatus(value = HttpStatus.OK)
@Transactional(propagation = Propagation.REQUIRED)
public List<TaskResponse> recoverTask(@PathVariable("taskId") String taskId, @RequestBody(required = false) TaskActionRequest actionRequest) {
List<TaskResponse> responses = new ArrayList<TaskResponse>();
HistoricTaskInstance historicTaskInstance = getHistoricTaskFromRequest(taskId);
/*List<Task> tasks = taskExtService.recoverTask(historicTaskInstance.getId());
for(Task nextTask : tasks){
TaskExt taskExt = taskExtService.getTaskExtById(nextTask.getId());
responses.add(restResponseFactory.createTaskResponse(taskExt));
}*/
return responses;
}
Aggregations