Enumeration keys = newDefVerIdList.keys();
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement(); // Old DefId
String defVerId = (String) newDefVerIdList.get(key); // New
ProcessDefinition pd=null;
String fullFileName="";
try{
fullFileName = DEFINITION_ROOT + defVerId + ".process";
pd = ProcessDefinitionFactory.getDefinition(new FileInputStream(fullFileName));
}catch (Exception e) {
continue;
}
//sub-process
ActivityForLoop forLoop = new ActivityForLoop() {
public void logic(Activity act) {
try {
if (act instanceof SubProcessActivity) {
SubProcessActivity spAct = (SubProcessActivity) act;
String oldAlias = (spAct.getDefinitionId().split("@")[0]).substring(1,(spAct.getDefinitionId().split("@")[0]).length() - 1);
String oldDefVerId = spAct.getDefinitionId().split("@")[1];
String newAlias = (String) newAliasListTmp.get(oldAlias);
String newpdvId = (String) newDefVerIdListTmp.get(oldDefVerId);
String newdefVerid = "[" + newAlias + "]@"+ newpdvId;
spAct.setDefinitionId(newdefVerid);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
};
forLoop.run(pd);
//form
ProcessVariable[] pvs = pd.getProcessVariables();
if (pvs != null) {
for (int j = 0; j < pvs.length; j++) {
Object dv = pvs[j].getDefaultValue();
if (dv instanceof org.uengine.contexts.HtmlFormContext) {
String formDefId = ((org.uengine.contexts.HtmlFormContext) dv).getFormDefId();// "[alias]@defverid"