snaker-core/src/main/java/org/snaker/engine/core/TaskService.java
public HistoryTask history(Execution execution, CustomModel model) {
		HistoryTask historyTask = new HistoryTask();
		historyTask.setId(StringHelper.getPrimaryKey());
		historyTask.setOrderId(execution.getOrder().getId());
		String currentTime = DateHelper.getTime();
		historyTask.setCreateTime(currentTime);
		historyTask.setFinishTime(currentTime);
		historyTask.setDisplayName(model.getDisplayName());
		historyTask.setTaskName(model.getName());
		historyTask.setTaskState(STATE_FINISH);
		historyTask.setTaskType(TaskType.Record.ordinal());
		historyTask.setParentTaskId(execution.getTask() == null ?
				START : execution.getTask().getId());
		historyTask.setVariable(JsonHelper.toJson(execution.getArgs()));
		access().saveHistory(historyTask);
		return historyTask;
	}
public HistoryTask history(Execution execution, CustomModel model) {
		HistoryTask historyTask = new HistoryTask();
		historyTask.setId(StringHelper.getPrimaryKey());
		historyTask.setOrderId(execution.getOrder().getId());
		String currentTime = DateHelper.getTime();
		historyTask.setCreateTime(currentTime);
		historyTask.setFinishTime(currentTime);
		historyTask.setDisplayName(model.getDisplayName());
		historyTask.setTaskName(model.getName());
		historyTask.setTaskState(STATE_FINISH);
		historyTask.setTaskType(TaskType.Record.ordinal());
		historyTask.setParentTaskId(execution.getTask() == null ?
				START : execution.getTask().getId());
		historyTask.setVariable(JsonHelper.toJson(execution.getArgs()));
		access().saveHistory(historyTask);
		return historyTask;
	}
public HistoryTask history ( Execution execution , CustomModel model ) { HistoryTask historyTask = new HistoryTask ( ) ; historyTask . setId ( StringHelper . getPrimaryKey ( ) ) ; historyTask . setOrderId ( execution . getOrder ( ) . getId ( ) ) ; String currentTime = DateHelper . getTime ( ) ; historyTask . setCreateTime ( currentTime ) ; historyTask . setFinishTime ( currentTime ) ; historyTask . setDisplayName ( model . getDisplayName ( ) ) ; historyTask . setTaskName ( model . getName ( ) ) ; historyTask . setTaskState ( STATE_FINISH ) ; historyTask . setTaskType ( TaskType . Record . ordinal ( ) ) ; historyTask . setParentTaskId ( execution . getTask ( ) == null ? START : execution . getTask ( ) . getId ( ) ) ; historyTask . setVariable ( JsonHelper . toJson ( execution . getArgs ( ) ) ) ; access ( ) . saveHistory ( historyTask ) ; return historyTask ; }
任务历史记录方法
@param execution 执行对象
@param model 自定义节点模型
@return 历史任务对象
任务历史记录方法