//taskInstance.setAssignee(Authentication.getAuthenticatedUserId());
commandContext.getTaskManager().saveTaskInstanceEntity(taskInstanceNew);
}
else{
TaskQuery taskQueryNew=taskService.createTaskQuery().processInstanceId(processInstanceId);
List<TaskInstance> taskQueryCandidateList = taskQueryNew.taskCandidateUser(Authentication.getAuthenticatedUserId()).taskNotEnd().list();
if(taskQueryCandidateList.size()>0){
taskInstanceNew=(TaskInstanceEntity)taskQueryCandidateList.get(0);
taskInstanceNew.setDraft(true);
if(this.agent!=null&&!this.agent.equals("")){
taskInstanceNew.setAgent(Authentication.getAuthenticatedUserId());