use of org.apache.ode.bpel.iapi.ProcessConf in project carbon-business-process by wso2.
the class ProcessStoreImpl method onBPELPackageDeployment.
public void onBPELPackageDeployment(Integer tenantId, final String duName, final String duLocation, final List<ProcessConfigurationImpl> processConfs) {
boolean status = exec(new Callable<Boolean>() {
@Override
public Boolean call(ConfStoreConnection conn) {
DeploymentUnitDAO duDao = conn.getDeploymentUnit(duName);
if (duDao != null) {
/*
This is for clustering scenario. update/deployment
*/
return true;
}
duDao = conn.createDeploymentUnit(duName);
duDao.setDeploymentUnitDir(duLocation);
for (ProcessConf pConf : processConfs) {
try {
ProcessConfDAO processConfDao = duDao.createProcess(pConf.getProcessId(), pConf.getType(), pConf.getVersion());
processConfDao.setState(pConf.getState());
for (Map.Entry<QName, Node> prop : pConf.getProcessProperties().entrySet()) {
processConfDao.setProperty(prop.getKey(), DOMUtils.domToString(prop.getValue()));
}
conn.setVersion(pConf.getVersion());
} catch (Exception e) {
String errmsg = "Error persisting deployment record for " + pConf.getProcessId() + "; process will not be available after restart!";
log.error(errmsg, e);
return false;
}
}
return true;
}
});
if (status) {
CopyOnWriteArrayList<QName> pids = new CopyOnWriteArrayList<QName>();
for (ProcessConf pConf : processConfs) {
pids.add(pConf.getProcessId());
}
updateProcessAndDUMaps(tenantId, duName, pids, true);
for (ProcessConfigurationImpl processConf : processConfs) {
fireEvent(new ProcessStoreEvent(ProcessStoreEvent.Type.DEPLOYED, processConf.getProcessId(), duName));
fireStateChange(processConf.getProcessId(), processConf.getState(), duName);
}
}
}
use of org.apache.ode.bpel.iapi.ProcessConf in project carbon-business-process by wso2.
the class ProcessStoreImpl method onBPELPackageReload.
public void onBPELPackageReload(Integer tenantId, String duName, List<ProcessConfigurationImpl> pConfs) {
CopyOnWriteArrayList<QName> pids = new CopyOnWriteArrayList<QName>();
for (ProcessConf pConf : pConfs) {
pids.add(pConf.getProcessId());
}
updateProcessAndDUMaps(tenantId, duName, pids, true);
Collections.sort(pConfs, BY_DEPLOYEDDATE);
for (ProcessConfigurationImpl processConfiguration : pConfs) {
try {
if (log.isDebugEnabled()) {
log.debug("Firing state change event --" + processConfiguration.getState() + "-- for process conf " + processConfiguration.getPackage() + "located at " + processConfiguration.getAbsolutePathForBpelArchive());
}
fireStateChange(processConfiguration.getProcessId(), processConfiguration.getState(), duName);
} catch (Exception e) {
log.error("Error while firing state change event for process " + processConfiguration.getProcessId() + " in deployment unit " + duName + ".");
}
}
}
Aggregations