Search in sources :

Example 1 with TaskResponse

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;
}
Also used : Task(org.flowable.engine.task.Task) ArrayList(java.util.ArrayList) TaskResponse(com.plumdo.flow.rest.task.TaskResponse) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with TaskResponse

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;
}
Also used : TaskResponse(com.plumdo.flow.rest.task.TaskResponse)

Example 3 with TaskResponse

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;
}
Also used : HistoricTaskInstance(org.flowable.engine.history.HistoricTaskInstance) ArrayList(java.util.ArrayList) TaskResponse(com.plumdo.flow.rest.task.TaskResponse) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

TaskResponse (com.plumdo.flow.rest.task.TaskResponse)3 ArrayList (java.util.ArrayList)2 Transactional (org.springframework.transaction.annotation.Transactional)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)2 HistoricTaskInstance (org.flowable.engine.history.HistoricTaskInstance)1 Task (org.flowable.engine.task.Task)1