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 GetProcessDefinitionDivCmd implements Command<String> {
    protected String processDefinitionId;

    public GetProcessDefinitionDivCmd(String processDefinitionId) {
        this.processDefinitionId = processDefinitionId;
    }

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