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;
/**
 * 获取流程定义图形大小
 * @author lw
 */
public class GetProcessDiagramSize implements Command<String[]> {
    protected String processDefinitionId;

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

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