}
}
private void loadExistingBPELPackage(String bpelPackageName) {
DeploymentUnitDAO duDAO = parentProcessStore.getDeploymentUnitDAO(bpelPackageName);
if (duDAO == null) {
String errMsg = "Cannot find DeploymentUnitDAO instance for package "
+ bpelPackageName + ".";
log.error(errMsg);
throw new BPELDeploymentException(errMsg);
}
File bpelPackage = findBPELPackageInFileSystem(duDAO);
if (bpelPackage == null || !bpelPackage.exists()) {
throw new BPELDeploymentException("Deployed directory " +
(bpelPackage == null ? "(unknown)" : bpelPackage) + " no longer there!");
}
DeploymentUnitDir du = new DeploymentUnitDir(bpelPackage);
du.setVersion(du.getStaticVersion());
du.scan();
List<ProcessConfigurationImpl> loaded = new ArrayList<ProcessConfigurationImpl>();
List<QName> processIds = new ArrayList<QName>();
for (ProcessConfDAO pConfDAO : duDAO.getProcesses()) {
TDeployment.Process processDD = du.getProcessDeployInfo(pConfDAO.getType());
if (processDD == null) {
log.warn("Cannot load " + pConfDAO.getPID() + "; cannot find descriptor.");
continue;
}
// TODO: update the props based on the values in the DB.
ProcessConfigurationImpl pConf = new ProcessConfigurationImpl(
tenantId,
processDD,
du,
duDAO.getDeployDate(),
parentProcessStore.getEndpointReferenceContext(),
tenantConfigContext);
pConf.setState(pConfDAO.getState());
processIds.add(pConfDAO.getPID());
processes.put(pConf.getProcessId(), pConf);