use of org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl in project carbon-business-process by wso2.
the class Processes method disableProcess.
public String disableProcess(String processQnameLocalPart) {
int processCount = ((ProcessStoreImpl) processStore).getProcesses().size();
QName name = null;
if (processCount != 0) {
for (int i = 0; i < processCount; i++) {
if (processQnameLocalPart.equalsIgnoreCase(((ProcessStoreImpl) processStore).getProcesses().get(i).getLocalPart().toString())) {
name = ((ProcessStoreImpl) processStore).getProcesses().get(i);
}
}
if (name != null) {
((ProcessStoreImpl) processStore).setState(name, ProcessState.DISABLED);
return "successfully disabled " + processQnameLocalPart;
} else {
return "no process with specified name";
}
} else {
return "no processess deployed";
}
}
use of org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl in project carbon-business-process by wso2.
the class BPELServerImpl method initProcessStore.
/**
* Initialize process store/
*
* @param eprContext Endpoint reference context
* @throws Exception if process store initialization failed
*/
private void initProcessStore(EndpointReferenceContext eprContext) throws Exception {
processStore = new ProcessStoreImpl(eprContext, db.getDataSource(), odeConfigurationProperties);
processStore.setLocalBPELDeploymentUnitRepo(new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "bpel"));
processStore.registerListener(new ProcessStoreListenerImpl());
}
use of org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl in project carbon-business-process by wso2.
the class BPELProcessStateChangedCommand method execute.
@Override
public void execute(ConfigurationContext configurationContext) throws ClusteringFault {
if (log.isDebugEnabled()) {
log.debug("New state changed command received. Process: " + pid + " New state: " + processState + " Tenant: " + tenantId);
}
ProcessStoreImpl parentProcessStore = (ProcessStoreImpl) configurationContext.getAxisConfiguration().getParameter(BPELConstants.PARAM_PARENT_PROCESS_STORE).getValue();
TenantProcessStore tenantProcessStore = parentProcessStore.getTenantsProcessStore(tenantId);
tenantProcessStore.handleBPELProcessStateChangedNotification(pid, processState);
}
use of org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl in project carbon-business-process by wso2.
the class Processes method getProcessStates.
public String[] getProcessStates() {
BPELServer bpelServer = BPELServiceComponent.getBPELServer();
processStore = bpelServer.getMultiTenantProcessStore();
int processCount = ((ProcessStoreImpl) processStore).getProcesses().size();
String[] processStates = new String[processCount];
if (processCount != 0) {
for (int i = 0; i < processCount; i++) {
StringBuffer buffer = new StringBuffer();
buffer.append(((ProcessStoreImpl) processStore).getProcesses().get(i).getLocalPart().toString());
buffer.append(" State-");
buffer.append(((ProcessStoreImpl) processStore).getProcessConfiguration(((ProcessStoreImpl) processStore).getProcesses().get(i)).getState().toString());
processStates[i] = buffer.toString();
}
}
return processStates;
}
use of org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl in project carbon-business-process by wso2.
the class Processes method retireProcess.
public String retireProcess(String processQnameLocalPart) {
int processCount = ((ProcessStoreImpl) processStore).getProcesses().size();
QName name = null;
if (processCount != 0) {
for (int i = 0; i < processCount; i++) {
if (processQnameLocalPart.equalsIgnoreCase(((ProcessStoreImpl) processStore).getProcesses().get(i).getLocalPart().toString())) {
name = ((ProcessStoreImpl) processStore).getProcesses().get(i);
}
}
if (name != null) {
((ProcessStoreImpl) processStore).setState(name, ProcessState.RETIRED);
return "successfully retired " + processQnameLocalPart;
} else {
return "no process with specified name";
}
} else {
return "No processess deployed";
}
}
Aggregations