snaker-core/src/main/java/org/snaker/engine/core/TaskService.java
public Task rejectTask(ProcessModel model, Task currentTask) {
		String parentTaskId = currentTask.getParentTaskId();
		if(StringHelper.isEmpty(parentTaskId) || parentTaskId.equals(START)) {
			throw new SnakerException("上一步任务ID为空，无法驳回至上一步处理");
		}
		NodeModel current = model.getNode(currentTask.getTaskName());
		HistoryTask history = access().getHistTask(parentTaskId);
		NodeModel parent = model.getNode(history.getTaskName());
		if(!NodeModel.canRejected(current, parent)) {
			throw new SnakerException("无法驳回至上一步处理，请确认上一步骤并非fork、join、suprocess以及会签任务");
		}

		Task task = history.undoTask();
		task.setId(StringHelper.getPrimaryKey());
		task.setCreateTime(DateHelper.getTime());
		task.setOperator(history.getOperator());
		access().saveTask(task);
		assignTask(task.getId(), task.getOperator());
		return task;
	}
public Task rejectTask(ProcessModel model, Task currentTask) {
		String parentTaskId = currentTask.getParentTaskId();
		if(StringHelper.isEmpty(parentTaskId) || parentTaskId.equals(START)) {
			throw new SnakerException("上一步任务ID为空，无法驳回至上一步处理");
		}
		NodeModel current = model.getNode(currentTask.getTaskName());
		HistoryTask history = access().getHistTask(parentTaskId);
		NodeModel parent = model.getNode(history.getTaskName());
		if(!NodeModel.canRejected(current, parent)) {
			throw new SnakerException("无法驳回至上一步处理，请确认上一步骤并非fork、join、suprocess以及会签任务");
		}

		Task task = history.undoTask();
		task.setId(StringHelper.getPrimaryKey());
		task.setCreateTime(DateHelper.getTime());
		task.setOperator(history.getOperator());
		access().saveTask(task);
		assignTask(task.getId(), task.getOperator());
		return task;
	}
public Task rejectTask ( ProcessModel model , Task currentTask ) { String parentTaskId = currentTask . getParentTaskId ( ) ; if ( StringHelper . isEmpty ( parentTaskId ) || parentTaskId . equals ( START ) ) { throw new SnakerException ( "上一步任务ID为空，无法驳回至上一步处理"); } NodeModel current = model . getNode ( currentTask . getTaskName ( ) ) ; HistoryTask history = access ( ) . getHistTask ( parentTaskId ) ; NodeModel parent = model . getNode ( history . getTaskName ( ) ) ; if ( ! NodeModel . canRejected ( current , parent ) ) { throw new SnakerException ( "无法驳回至上一步处理，请确认上一步骤并非fork、join、suprocess以及会签任务"); } Task task = history . undoTask ( ) ; task . setId ( StringHelper . getPrimaryKey ( ) ) ; task . setCreateTime ( DateHelper . getTime ( ) ) ; task . setOperator ( history . getOperator ( ) ) ; access ( ) . saveTask ( task ) ; assignTask ( task . getId ( ) , task . getOperator ( ) ) ; return task ; }
驳回任务
驳回任务