pdr.setName(newName);
//2011.1.11 add by yookjy
//rename upd
String pdvid = String.valueOf(pdr.getProdVerId());
ProcessDefinitionFactory pdf = ProcessDefinitionFactory.getInstance(getTransactionContext());
ProcessDefinition pd = pdf.getDefinition(pdvid);
pd.setName(newName);
//rename process definition version
ProcessDefinitionVersionRepositoryHomeLocal pdvhr = GlobalContext.createProcessDefinitionVersionRepositoryHomeLocal(tc);
ProcessDefinitionVersionRepositoryLocal pdvr = pdvhr.findByPrimaryKey(new Long(pdvid));
pdvr.setDefName(newName);
//restore upd file
String path = null;
String def = (String)pdvr.getFilePath();
if(def.startsWith("LINK:")){
path = def.substring("LINK:".length());
}
pdf.storeProcessDefinition(path, pd);
//restore cached file
pdf.compileDefinition(DEFINITION_ROOT + path, pd);
//remove cache
pdf.removeFromCache(pdvid);
}catch(Exception e){
e.printStackTrace();
throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
}
}