Hashtable newDefIdList,
Hashtable newDefVerIdList,
Hashtable newAliasList) throws Exception {
for (int i = 0; i < ua.getDefinitionList().size(); i++) {
DefinitionArchive da = (DefinitionArchive) ua.getDefinitionList().get(i);
DefinitionArchive fixedDa = (DefinitionArchive) edited_ua.getDefinitionList().get(i);
String[] deployedDefinitionInformation = null;
if (!da.isRoot()&& fixedDa.getArchiveFileName().equals(da.getArchiveFileName()) && !"folder".equals(da.getObjectType())) {
String key = da.getName() + "." + da.getAlias() + "." + da.getId() + "." + da.getObjectType();
String definitionDoc = (String) inputStreamList.get(key);
if (definitionDoc != null) {
Map objectOptions = new HashMap();
objectOptions.put("alias", fixedDa.getAlias());
objectOptions.put("objectType", da.getObjectType());
if ("new".equals(command[i])) {
String parentFolder = (String) newDefIdList.get(da.getParentFolder());
deployedDefinitionInformation = ProcessDefinitionFactory.getInstance(getTransactionContext()).addDefinitionImpl(
null, null, 1, fixedDa.getName(), null, false, definitionDoc, parentFolder, false, objectOptions);
} else if ("update".equals(command[i])) {
String parentFolder = null;
ProcessDefinitionRemote[] pdrs = listProcessDefinitionRemotesLight();
for (int j = 0; j < pdrs.length; j++) {
ProcessDefinitionRemote tempPdr = pdrs[i];
if ((!tempPdr.isFolder) && ((tempPdr.getAlias()).equals(fixedDa.getAlias())) && (fixedDa.getAlias() != null && !fixedDa.getAlias().equals(""))) {
parentFolder = tempPdr.getParentFolder();
}
}
String pdId = getProcessDefinitionIdByAlias(fixedDa.getAlias());
ProcessDefinitionRemote[] findLastVersion = findAllVersions(pdId);
int versionId = 0;
for (int j = 0; j < findLastVersion.length; j++) {
int compareVersionId = findLastVersion[j].getVersion();
if (versionId < compareVersionId) {
versionId = compareVersionId;
}
}
deployedDefinitionInformation = ProcessDefinitionFactory.getInstance(getTransactionContext()).addDefinitionImpl(
pdId, null, versionId+1, fixedDa.getName(), null, false, definitionDoc, parentFolder, false, objectOptions);
}
String pdvId = deployedDefinitionInformation[0];
newDefIdList.put(da.getBelongingId(),deployedDefinitionInformation[1]);
newDefVerIdList.put(da.getId(),pdvId);
newAliasList.put(da.getAlias(), fixedDa.getAlias());
setProcessDefinitionProductionVersion(pdvId);
if ("form".equals(da.getObjectType())) {
saveFormFilesForImport(definitionDoc, pdvId);