throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
}
}
private Hashtable setFormsForExport(String rootDirectory,Hashtable options) throws Exception {
UEngineArchive ua = (UEngineArchive) options.get(UEngineArchive.UENGINE_ARCHIVE);
for (int i=0; i<ua.getDefinitionList().size(); i++) {
DefinitionArchive da = (DefinitionArchive)ua.getDefinitionList().get(i);
if(!"process".equals(da.getObjectType())) continue;
String subDefVerId = da.getId();
ProcessVariable[] pvs = null;
try {
pvs = getProcessDefinition(subDefVerId).getProcessVariables();
} catch (Exception ex) {
System.out.println("Exception subDefVerId : " + subDefVerId);
continue;
}
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"
if (UEngineUtil.isNotEmpty(formDefId)) {
String formAlias = formDefId.substring(1, formDefId.indexOf("]"));
String defVerId = getProcessDefinitionProductionVersionByAlias(formAlias);
ProcessDefinitionRemote formPdr = getProcessDefinitionRemote(defVerId);
if (!ua.containKeys(formPdr.getBelongingDefinitionId()) ) {
//_SubProc folder create
ua.setDefinitionList("_Form","", "_Form", "", ZipEntryMapper.TYPE_FOLDER ,"_Form" ,"", ua.getMainProcessDefinition().getBelongingId(), "", false);
String fileName = ZipEntryMapper.ENTRY_SEPARATOR+formPdr.getName().getText()+ZipEntryMapper.ENTRY_SEPARATOR+formPdr.getAlias()+ZipEntryMapper.ENTRY_SEPARATOR+formPdr.getId()+ZipEntryMapper.ENTRY_SEPARATOR+formPdr.getObjType();
String desc = formPdr.getDescription() == null ? "" : formPdr.getDescription().getText();
ua.setDefinitionList(formPdr.getName().getText(), formPdr.getAlias(), formPdr.getBelongingDefinitionId(), String.valueOf(formPdr.getVersion()), formPdr.getObjType(),fileName,desc , "_Form", formPdr.getId(), false);
getFilePathNFileCopy(formPdr, rootDirectory + File.separatorChar + "_Form" + File.separatorChar, false);
}
}
}
}