ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();
ProcessDefinitionBehavior processDefinition = null;
if(processDefinitionId!=null)
processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);
else
processDefinition = processDefinitionManager.findLatestProcessDefinitionByKey(processDefinitionKey);
DefinitionsBehavior definitions = processDefinition.getDefinitions();
Map<String, Map<String, Object>> positionInfo=new HashMap<String, Map<String,Object>>();
this.definitions=definitions;
List<BPMNDiagram> BPMNDiagramList = definitions.getDiagrams();