use of org.apache.ode.bpel.dao.ProcessDAO in project carbon-business-process by wso2.
the class ProcessManagementServiceSkeleton method updateDeployInfo.
/*When a user modifies deploy info table they are updated in this method
*
* @param processDeployDetailsList
*
*/
public void updateDeployInfo(ProcessDeployDetailsList_type0 processDeployDetailsListType) throws ProcessManagementException {
final QName processId = processDeployDetailsListType.getProcessName();
try {
TenantProcessStoreImpl tenantProcessStore = AdminServiceUtils.getTenantProcessStore();
ProcessConfigurationImpl processConf = (ProcessConfigurationImpl) tenantProcessStore.getProcessConfiguration(processId);
final boolean oldIsInmemory = processConf.isTransient();
final boolean newIsInmemory = processDeployDetailsListType.getIsInMemory();
processConf.setState(getProcessState(processDeployDetailsListType));
processConf.setIsTransient(newIsInmemory);
processConf.setProcessEventsList(processDeployDetailsListType.getProcessEventsList());
processConf.setGenerateType(processDeployDetailsListType.getProcessEventsList());
processConf.setProcessCleanupConfImpl(processDeployDetailsListType.getCleanUpList());
if (tenantProcessStore.getBPELPackageRepository() != null) {
tenantProcessStore.getBPELPackageRepository().createPropertiesForUpdatedDeploymentInfo(processConf);
}
bpelServer.getODEBPELServer().getContexts().scheduler.execTransaction(new java.util.concurrent.Callable<Boolean>() {
public Boolean call() throws Exception {
ProcessDAO processDAO;
ProcessDAO newProcessDAO;
if (oldIsInmemory & !newIsInmemory) {
processDAO = bpelServer.getODEBPELServer().getContexts().getInMemDao().getConnection().getProcess(processId);
if (bpelServer.getODEBPELServer().getContexts().dao.getConnection().getProcess(processId) == null) {
newProcessDAO = bpelServer.getODEBPELServer().getContexts().dao.getConnection().createProcess(processDAO.getProcessId(), processDAO.getType(), processDAO.getGuid(), processDAO.getVersion());
Set<String> correlatorsSet = processDAO.getCorrelatorsSet();
for (String correlator : correlatorsSet) {
newProcessDAO.addCorrelator(correlator);
}
}
} else if (!oldIsInmemory & newIsInmemory) {
QName pId = processId;
processDAO = bpelServer.getODEBPELServer().getContexts().dao.getConnection().getProcess(pId);
if (bpelServer.getODEBPELServer().getContexts().getInMemDao().getConnection().getProcess(pId) == null) {
newProcessDAO = bpelServer.getODEBPELServer().getContexts().getInMemDao().getConnection().createProcess(processDAO.getProcessId(), processDAO.getType(), processDAO.getGuid(), processDAO.getVersion());
Set<String> correlatorsSet = processDAO.getCorrelatorsSet();
for (String correlator : correlatorsSet) {
newProcessDAO.addCorrelator(correlator);
}
}
}
return true;
}
});
} catch (Exception e) {
String errMsg = "Error occurred while updating deployment info for: " + processId;
log.error(errMsg, e);
throw new ProcessManagementException(errMsg, e);
}
}
Aggregations