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

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

import com.blueland.bpm.engine.util.CustomProcessDiagramGenerator;
/**
 * 获取流程历史div图形
 * @author lw
 */
public class GetHistoryProcessDivCmd implements Command<String> {
    protected String historyProcessInstanceId;

    public GetHistoryProcessDivCmd(String historyProcessInstanceId) {
        this.historyProcessInstanceId = historyProcessInstanceId;
    }

	public String execute(CommandContext commandContext) {
		try {
			CustomProcessDiagramGenerator customProcessDiagramGenerator = new CustomProcessDiagramGenerator();
			return customProcessDiagramGenerator
					.getHistoryProcessDiv(historyProcessInstanceId);
		} catch (Exception ex) {
			throw new RuntimeException(ex);
		}
	}
}
