Collection definitions = pdhr.findAllProcessDefinitions();
Vector processDefinitionRemotes = new Vector();
for(Iterator iter = definitions.iterator(); iter.hasNext();){
ProcessDefinitionRepositoryLocal pdrl = ((ProcessDefinitionRepositoryLocal)iter.next());
ProcessDefinitionRemote pdr = new ProcessDefinitionRemote();
pdr.setId(pdrl.getDefId().toString());
pdr.setFolder(pdrl.getIsFolder());
pdr.setParentFolder(pdrl.getParentFolder().toString());
pdr.setName(TextContext.createInstance());
pdr.getName().setText(pdrl.getName());
pdr.setBelongingDefinitionId(pdr.getId());
pdr.setAlias(pdrl.getAlias());
pdr.setVisible(pdrl.getIsVisible());
pdr.objType = pdrl.getObjType();
if(!org.uengine.util.UEngineUtil.isNotEmpty(pdr.objType)) {
pdr.objType = "process";
}
String definitionGroupId = pdr.getBelongingDefinitionId();
String objType = pdr.getObjType();
if(!pdr.isFolder()){
int productionVersion = pdrl.getProdVer();
//Object[] nameAndVersion = UEngineUtil.getProcessNameAndVersion(pdr.getName());
//String name = (String)nameAndVersion[0];
Collection versions = pdihr.findAllVersions(new Long(pdr.getId()));
for(Iterator iter2 = versions.iterator(); iter2.hasNext();){
ProcessDefinitionVersionRepositoryLocal pdirl = ((ProcessDefinitionVersionRepositoryLocal)iter2.next());
pdr = new ProcessDefinitionRemote();
pdr.setId(pdirl.getDefVerId().toString());
pdr.setFolder(false);
pdr.setParentFolder(pdrl.getParentFolder().toString());
pdr.setName(TextContext.createInstance());
pdr.getName().setText(pdrl.getName());
pdr.setVersion(pdirl.getVer().intValue());
pdr.setBelongingDefinitionId(definitionGroupId);
pdr.setObjType(objType);
pdr.setAlias(pdrl.getAlias());
pdr.setVisible(pdrl.getIsVisible());
if(pdirl.getVer().intValue() == productionVersion)
pdr.setProduction(true);
processDefinitionRemotes.add(pdr);