Search in sources :

Example 6 with BPELPackageInfo

use of org.wso2.carbon.bpel.core.ode.integration.store.repository.BPELPackageInfo in project carbon-business-process by wso2.

the class BPELPackageRepository method getBPELPackages.

public List<BPELPackageInfo> getBPELPackages() throws Exception {
    List<BPELPackageInfo> bpelPackages = new ArrayList<BPELPackageInfo>();
    try {
        if (configRegistry.resourceExists(BPELConstants.REG_PATH_OF_BPEL_PACKAGES)) {
            Resource parentCollection = configRegistry.get(BPELConstants.REG_PATH_OF_BPEL_PACKAGES);
            // The above registry resource we retrieve only contains set of child collections.
            // So we can directly cast the returned object to a string array.
            String[] children = (String[]) parentCollection.getContent();
            for (int i = children.length - 1; i >= 0; i--) {
                bpelPackages.add(getBPELPackageInfo(children[i]));
            }
            return sortByPackageName(bpelPackages);
        }
    } catch (RegistryException re) {
        handleExceptionWithRollback("Unable to get BPEL Packages from Repository.", re);
    }
    return null;
}
Also used : ArrayList(java.util.ArrayList) Resource(org.wso2.carbon.registry.core.Resource) RegistryException(org.wso2.carbon.registry.core.exceptions.RegistryException)

Example 7 with BPELPackageInfo

use of org.wso2.carbon.bpel.core.ode.integration.store.repository.BPELPackageInfo in project carbon-business-process by wso2.

the class TenantProcessStoreImpl method reloadExistingVersionsOfBPELPackage.

/**
 * Reload old versions of BPEL package. This is used to handle restart of BPS server.
 * At restart based on the last modified time of the BPEL archives we'll reload all the versions
 * of that BPEL archive.
 *
 * @param deploymentContext information about current deployment
 * @throws RegistryException                                                                     on error loading
 * resources from registry.
 * @throws org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.ProcessManagementException
 */
private void reloadExistingVersionsOfBPELPackage(BPELDeploymentContext deploymentContext) throws RegistryException, ProcessManagementException {
    BPELPackageInfo bpelPackage = repository.getBPELPackageInfo(deploymentContext);
    String lastActivePackageName = null;
    for (String packageName : bpelPackage.getAvailableVersions()) {
        if (deploymentUnits.containsKey(packageName)) {
            lastActivePackageName = packageName;
        } else {
            // version of the package
            if (null != lastActivePackageName && isConfigRegistryReadOnly()) {
                loadExistingBPELPackage(lastActivePackageName);
            }
            loadExistingBPELPackage(packageName);
        }
    }
}
Also used : BPELPackageInfo(org.wso2.carbon.bpel.core.ode.integration.store.repository.BPELPackageInfo)

Aggregations

BPELPackageInfo (org.wso2.carbon.bpel.core.ode.integration.store.repository.BPELPackageInfo)3 PackageType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.PackageType)3 BPELUIException (org.wso2.carbon.bpel.core.ode.integration.store.BPELUIException)2 TenantProcessStoreImpl (org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStoreImpl)2 BPELPackageRepository (org.wso2.carbon.bpel.core.ode.integration.store.repository.BPELPackageRepository)2 PackageManagementException (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.PackageManagementException)2 DeployedPackagesPaginated (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.DeployedPackagesPaginated)2 Resource (org.wso2.carbon.registry.core.Resource)2 ArrayList (java.util.ArrayList)1 Version_type0 (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Version_type0)1 Versions_type0 (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Versions_type0)1 RegistryException (org.wso2.carbon.registry.core.exceptions.RegistryException)1