snaker-core/src/main/java/org/snaker/engine/core/TaskService.java
public Task withdrawTask(String taskId, String operator) {
		HistoryTask hist = access().getHistTask(taskId);
		AssertHelper.notNull(hist, "指定的历史任务[id=" + taskId + "]不存在");
		List<Task> tasks;
		if(hist.isPerformAny()) {
			tasks = access().getNextActiveTasks(hist.getId());
		} else {
			tasks = access().getNextActiveTasks(hist.getOrderId(), 
					hist.getTaskName(), hist.getParentTaskId());
		}
		if(tasks == null || tasks.isEmpty()) {
			throw new SnakerException("后续活动任务已完成或不存在，无法撤回.");
		}
		for(Task task : tasks) {
			access().deleteTask(task);
		}
		
		Task task = hist.undoTask();
		task.setId(StringHelper.getPrimaryKey());
		task.setCreateTime(DateHelper.getTime());
		access().saveTask(task);
		assignTask(task.getId(), task.getOperator());
		return task;
	}
public Task withdrawTask(String taskId, String operator) {
		HistoryTask hist = access().getHistTask(taskId);
		AssertHelper.notNull(hist, "指定的历史任务[id=" + taskId + "]不存在");
		List<Task> tasks;
		if(hist.isPerformAny()) {
			tasks = access().getNextActiveTasks(hist.getId());
		} else {
			tasks = access().getNextActiveTasks(hist.getOrderId(), 
					hist.getTaskName(), hist.getParentTaskId());
		}
		if(tasks == null || tasks.isEmpty()) {
			throw new SnakerException("后续活动任务已完成或不存在，无法撤回.");
		}
		for(Task task : tasks) {
			access().deleteTask(task);
		}
		
		Task task = hist.undoTask();
		task.setId(StringHelper.getPrimaryKey());
		task.setCreateTime(DateHelper.getTime());
		access().saveTask(task);
		assignTask(task.getId(), task.getOperator());
		return task;
	}
public Task withdrawTask ( String taskId , String operator ) { HistoryTask hist = access ( ) . getHistTask ( taskId ) ; AssertHelper . notNull ( hist , "指定的历史任务[id=" + taskId + "] 存 "); List < Task > tasks ; if ( hist . isPerformAny ( ) ) { tasks = access ( ) . getNextActiveTasks ( hist . getId ( ) ) ; } else { tasks = access ( ) . getNextActiveTasks ( hist . getOrderId ( ) , hist . getTaskName ( ) , hist . getParentTaskId ( ) ) ; } if ( tasks == null || tasks . isEmpty ( ) ) { throw new SnakerException ( "后续活动任务已完成或不存在，无法撤回."); } for ( Task task : tasks ) { access ( ) . deleteTask ( task ) ; } Task task = hist . undoTask ( ) ; task . setId ( StringHelper . getPrimaryKey ( ) ) ; task . setCreateTime ( DateHelper . getTime ( ) ) ; access ( ) . saveTask ( task ) ; assignTask ( task . getId ( ) , task . getOperator ( ) ) ; return task ; }
撤回指定的任务
撤回指定的任务