Search in sources :

Example 1 with ProcessStoreImpl

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";
    }
}
Also used : ProcessStoreImpl(org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl) QName(javax.xml.namespace.QName)

Example 2 with ProcessStoreImpl

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());
}
Also used : TenantProcessStoreImpl(org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStoreImpl) ProcessStoreImpl(org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl) File(java.io.File)

Example 3 with ProcessStoreImpl

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);
}
Also used : ProcessStoreImpl(org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl) TenantProcessStore(org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStore)

Example 4 with ProcessStoreImpl

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;
}
Also used : ProcessStoreImpl(org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl) BPELServer(org.wso2.carbon.bpel.core.ode.integration.BPELServer)

Example 5 with ProcessStoreImpl

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";
    }
}
Also used : ProcessStoreImpl(org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl) QName(javax.xml.namespace.QName)

Aggregations

ProcessStoreImpl (org.wso2.carbon.bpel.core.ode.integration.store.ProcessStoreImpl)6 QName (javax.xml.namespace.QName)3 File (java.io.File)1 BPELServer (org.wso2.carbon.bpel.core.ode.integration.BPELServer)1 TenantProcessStore (org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStore)1 TenantProcessStoreImpl (org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStoreImpl)1