package com.blueland.bpm.engine.core.cmd;

import java.io.Serializable;
import java.util.Map;

import org.activiti.engine.impl.interceptor.Command;
import org.activiti.engine.impl.interceptor.CommandContext;

import com.blueland.bpm.engine.core.service.ProcessTransitionFreeService;

/**
 * 撤回上一步命令类
 * @author lw
 */
public class CallBackTaskCmd implements Command<Void>, Serializable {

	private static final long serialVersionUID = 1L;

	protected String taskId;
	protected String backActivityId;
	protected Map<String,Object> variables;

	public CallBackTaskCmd(String taskId,String backActivityId,Map<String,Object> variables) {
		this.taskId = taskId;
		this.backActivityId=backActivityId;
		this.variables=variables;
	}

	public Void execute(CommandContext commandContext) {
		ProcessTransitionFreeService baseWfService = new ProcessTransitionFreeService(
				commandContext.getProcessEngineConfiguration());
		baseWfService.commitProcess(taskId,backActivityId, variables);
		return null;
	}

}
