snaker-core/src/main/java/org/snaker/engine/core/SnakerEngineImpl.java
private Execution execute(String taskId, String operator, Map<String, Object> args) {
		if(args == null) args = new HashMap<String, Object>();
		Task task = task().complete(taskId, operator, args);
		if(log.isDebugEnabled()) {
			log.debug("任务[taskId=" + taskId + "]已完成");
		}
		Order order = query().getOrder(task.getOrderId());
		AssertHelper.notNull(order, "指定的流程实例[id=" + task.getOrderId() + "]已完成或不存在");
		order.setLastUpdator(operator);
		order.setLastUpdateTime(DateHelper.getTime());
		order().updateOrder(order);
		//协办任务完成不产生执行对象
		if(!task.isMajor()) {
			return null;
		}
		Map<String, Object> orderMaps = order.getVariableMap();
		if(orderMaps != null) {
			for(Map.Entry<String, Object> entry : orderMaps.entrySet()) {
				if(args.containsKey(entry.getKey())) {
					continue;
				}
				args.put(entry.getKey(), entry.getValue());
			}
		}
		Process process = process().getProcessById(order.getProcessId());
		Execution execution = new Execution(this, process, order, args);
		execution.setOperator(operator);
		execution.setTask(task);
		return execution;
	}
private Execution execute(String taskId, String operator, Map<String, Object> args) {
		if(args == null) args = new HashMap<String, Object>();
		Task task = task().complete(taskId, operator, args);
		if(log.isDebugEnabled()) {
			log.debug("任务[taskId=" + taskId + "]已完成");
		}
		Order order = query().getOrder(task.getOrderId());
		AssertHelper.notNull(order, "指定的流程实例[id=" + task.getOrderId() + "]已完成或不存在");
		order.setLastUpdator(operator);
		order.setLastUpdateTime(DateHelper.getTime());
		order().updateOrder(order);
		//协办任务完成不产生执行对象
		if(!task.isMajor()) {
			return null;
		}
		Map<String, Object> orderMaps = order.getVariableMap();
		if(orderMaps != null) {
			for(Map.Entry<String, Object> entry : orderMaps.entrySet()) {
				if(args.containsKey(entry.getKey())) {
					continue;
				}
				args.put(entry.getKey(), entry.getValue());
			}
		}
		Process process = process().getProcessById(order.getProcessId());
		Execution execution = new Execution(this, process, order, args);
		execution.setOperator(operator);
		execution.setTask(task);
		return execution;
	}
private Execution execute ( String taskId , String operator , Map < String , Object > args ) { if ( args == null ) args = new HashMap < String , Object > ( ) ; Task task = task ( ) . complete ( taskId , operator , args ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "任务[taskId=" + t s Id + " 已 成"); } Order order = query ( ) . getOrder ( task . getOrderId ( ) ) ; AssertHelper . notNull ( order , "指定的流程实例[id=" + task.getOrd r d()  +  "]已完成或不存在 " ) order . setLastUpdator ( operator ) ; order . setLastUpdateTime ( DateHelper . getTime ( ) ) ; order ( ) . updateOrder ( order ) ; //协办任务完成不产生执行对象 if ( ! task . isMajor ( ) ) { return null ; } Map < String , Object > orderMaps = order . getVariableMap ( ) ; if ( orderMaps != null ) { for ( Map . Entry < String , Object > entry : orderMaps . entrySet ( ) ) { if ( args . containsKey ( entry . getKey ( ) ) ) { continue ; } args . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } } Process process = process ( ) . getProcessById ( order . getProcessId ( ) ) ; Execution execution = new Execution ( this , process , order , args ) ; execution . setOperator ( operator ) ; execution . setTask ( task ) ; return execution ; }
根据任务主键ID，操作人ID，参数列表完成任务，并且构造执行对象
@param taskId 任务id
@param operator 操作人
@param args 参数列表
@return Execution
根据任务主键ID，操作人ID，参数列表完成任务，并且构造执行对象