String taskId = myTask.getId();
if( StringUtils.isEmpty(taskId) )
throw new ApplicationException("任务编号不能为空!");
ExecutionType type = myTask.getType();
if( type == null )
throw new ApplicationException("任务操作类型不能为空!");
String message = myTask.getMessage();
if( StringUtils.isEmpty(message) )
throw new ApplicationException("流转意见不能为空!");
Task task = taskService.createTaskQuery().taskId(myTask.getId()).singleResult();
if( task == null )
throw new ApplicationException("任务["+myTask.getId()+"]不存在!");
//task.getParentTaskId();
//identityService.setAuthenticatedUserId( user );
//保存操作日志
taskLogManager.save(task.getProcessInstanceId(),task.getId(),type,user, message);
Map<String,Object> variables = new HashMap<String,Object>();
variables.put(WorkflowConstant.TASK_ACTIOIN_VARIABLE_NAME,type.name());
variables.put("passed", ExecutionType.SUBMIT.equals(type)); //TODO
taskService.complete(taskId,variables); //提交
}