Search in sources :

Example 6 with CleanUpType

use of org.wso2.carbon.bpel.stub.mgt.types.CleanUpType in project carbon-business-process by wso2.

the class BpelUIUtil method updateBackEnd.

public static void updateBackEnd(ProcessManagementServiceClient processMgtClient, ProcessDeployDetailsList_type0 processDeployDetailsListType, DeploymentDescriptorUpdater deployDescriptorUpdater, String[] selecttype, List<String> scopeNames) throws Exception {
    updateScopeEvents(selecttype, scopeNames, deployDescriptorUpdater);
    ProcessStatus processStatus = ProcessStatus.Factory.fromValue(deployDescriptorUpdater.getProcessstate().toUpperCase());
    processDeployDetailsListType.setProcessState(processStatus);
    processDeployDetailsListType.setIsInMemory(Boolean.parseBoolean(deployDescriptorUpdater.getInmemorystatus()));
    ProcessEventsListType processEventsListType = new ProcessEventsListType();
    EnableEventListType enableEventListType = new EnableEventListType();
    ScopeEventListType scopeEventListType = new ScopeEventListType();
    enableEventListType.setEnableEvent(deployDescriptorUpdater.getEvents());
    scopeEventListType.setScopeEvent(deployDescriptorUpdater.getScopeEvents());
    processEventsListType.setEnableEventsList(enableEventListType);
    processEventsListType.setScopeEventsList(scopeEventListType);
    if (!deployDescriptorUpdater.getGentype().equalsIgnoreCase("selected")) {
        Generate_type1 generate = Generate_type1.Factory.fromValue(deployDescriptorUpdater.getGentype());
        processEventsListType.setGenerate(generate);
    }
    processDeployDetailsListType.setProcessEventsList(processEventsListType);
    CleanUpListType cleanUpList = new CleanUpListType();
    CleanUpType successCleanUpType = new CleanUpType();
    On_type1 successOn = On_type1.success;
    successCleanUpType.setOn(successOn);
    CategoryListType successCategoryList = new CategoryListType();
    String[] sCategories = deployDescriptorUpdater.getSuccesstypecleanups();
    if (sCategories != null) {
        for (String categoryName : sCategories) {
            Category_type1 categoryType1 = Category_type1.Factory.fromValue(categoryName);
            successCategoryList.addCategory(categoryType1);
        }
    }
    successCleanUpType.setCategoryList(successCategoryList);
    cleanUpList.addCleanUp(successCleanUpType);
    CleanUpType failureCleanUpType = new CleanUpType();
    On_type1 failureOn = On_type1.failure;
    failureCleanUpType.setOn(failureOn);
    CategoryListType failureCategoryList = new CategoryListType();
    String[] fCategories = deployDescriptorUpdater.getFailuretypecleanups();
    if (fCategories != null) {
        for (String categoryName : fCategories) {
            Category_type1 categoryType1 = Category_type1.Factory.fromValue(categoryName);
            failureCategoryList.addCategory(categoryType1);
        }
    }
    failureCleanUpType.setCategoryList(failureCategoryList);
    cleanUpList.addCleanUp(failureCleanUpType);
    processDeployDetailsListType.setCleanUpList(cleanUpList);
    processMgtClient.updateDeployInfo(processDeployDetailsListType);
}
Also used : ProcessEventsListType(org.wso2.carbon.bpel.stub.mgt.types.ProcessEventsListType) EnableEventListType(org.wso2.carbon.bpel.stub.mgt.types.EnableEventListType) ProcessStatus(org.wso2.carbon.bpel.stub.mgt.types.ProcessStatus) On_type1(org.wso2.carbon.bpel.stub.mgt.types.On_type1) Category_type1(org.wso2.carbon.bpel.stub.mgt.types.Category_type1) Generate_type1(org.wso2.carbon.bpel.stub.mgt.types.Generate_type1) CategoryListType(org.wso2.carbon.bpel.stub.mgt.types.CategoryListType) ScopeEventListType(org.wso2.carbon.bpel.stub.mgt.types.ScopeEventListType) CleanUpListType(org.wso2.carbon.bpel.stub.mgt.types.CleanUpListType) CleanUpType(org.wso2.carbon.bpel.stub.mgt.types.CleanUpType)

Example 7 with CleanUpType

use of org.wso2.carbon.bpel.stub.mgt.types.CleanUpType in project carbon-business-process by wso2.

the class BPELPackageRepository method readPropertiesOfUpdatedDeploymentInfo.

/**
 * Reads the updated properties from registry and sets the process configuration fields
 *
 * @param processConfiguration - Process's configuration details after updated
 * @param bpelPackageName      - the relevant bpel package
 * @throws RegistryException          on registry rollback error case, we'll init the cause to the
 *                                    original exception we got when accessing registry
 * @throws ProcessManagementException
 */
public void readPropertiesOfUpdatedDeploymentInfo(ProcessConfigurationImpl processConfiguration, String bpelPackageName) throws RegistryException, ProcessManagementException {
    String versionlessPackageName = BPELPackageRepositoryUtils.getVersionlessPackageName(bpelPackageName);
    String packageLocation = BPELPackageRepositoryUtils.getResourcePathForDeployInfoUpdatedBPELPackage(processConfiguration.getPackage(), versionlessPackageName);
    Resource bpelPackage = configRegistry.get(packageLocation);
    String stateInString = bpelPackage.getProperty(BPELConstants.BPEL_PROCESS_STATE + processConfiguration.getProcessId());
    String inMemoryInString = bpelPackage.getProperty(BPELConstants.BPEL_PROCESS_INMEMORY + processConfiguration.getProcessId());
    String processEventsInString = bpelPackage.getProperty(BPELConstants.BPEL_PROCESS_EVENTS + processConfiguration.getProcessId());
    String generateTypeString = bpelPackage.getProperty(BPELConstants.BPEL_PROCESS_EVENT_GENERATE + processConfiguration.getProcessId());
    String successCleanupsInString = bpelPackage.getProperty(BPELConstants.BPEL_INSTANCE_CLEANUP_SUCCESS + processConfiguration.getProcessId());
    String failureCleanupsInString = bpelPackage.getProperty(BPELConstants.BPEL_INSTANCE_CLEANUP_FAILURE + processConfiguration.getProcessId());
    // editor has been updated, read the updated fields
    if (stateInString != null) {
        ProcessState state = BPELPackageRepositoryUtils.getProcessState(stateInString);
        processConfiguration.setState(state);
        processConfiguration.setIsTransient(Boolean.parseBoolean(inMemoryInString));
        ProcessEventsListType processEventsList = new ProcessEventsListType();
        EnableEventListType enabledEventList = BPELPackageRepositoryUtils.getEnabledEventsListFromString(processEventsInString);
        processEventsList.setEnableEventsList(enabledEventList);
        Generate_type1 generateType = BPELPackageRepositoryUtils.getProcessGenerateTypeFromString(generateTypeString);
        processEventsList.setGenerate(generateType);
        ScopeEventListType scopeEventList = new ScopeEventListType();
        int j = 0;
        while (bpelPackage.getProperty(BPELConstants.BPEL_PROCESS_SCOPE_EVENT + (j + 1) + processConfiguration.getProcessId()) != null) {
            ScopeEventType scopeEvent = BPELPackageRepositoryUtils.getScopeEventFromString(bpelPackage.getProperty(BPELConstants.BPEL_PROCESS_SCOPE_EVENT + (j + 1) + processConfiguration.getProcessId()));
            scopeEventList.addScopeEvent(scopeEvent);
            j++;
        }
        processEventsList.setScopeEventsList(scopeEventList);
        processConfiguration.setProcessEventsList(processEventsList);
        CleanUpListType cleanUpList = new CleanUpListType();
        CleanUpType successCleanUp = BPELPackageRepositoryUtils.getSuccessCleanUpType(successCleanupsInString);
        cleanUpList.addCleanUp(successCleanUp);
        CleanUpType failureCleanUp = BPELPackageRepositoryUtils.getFailureCleanUpType(failureCleanupsInString);
        cleanUpList.addCleanUp(failureCleanUp);
        processConfiguration.setProcessCleanupConfImpl(cleanUpList);
    }
}
Also used : ProcessState(org.apache.ode.bpel.iapi.ProcessState) ProcessEventsListType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ProcessEventsListType) EnableEventListType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.EnableEventListType) ScopeEventType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ScopeEventType) Generate_type1(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Generate_type1) ScopeEventListType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ScopeEventListType) Resource(org.wso2.carbon.registry.core.Resource) CleanUpListType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CleanUpListType) CleanUpType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CleanUpType)

Example 8 with CleanUpType

use of org.wso2.carbon.bpel.stub.mgt.types.CleanUpType in project carbon-business-process by wso2.

the class BPELPackageRepositoryUtils method getSuccessCleanUpType.

public static CleanUpType getSuccessCleanUpType(String successCleanupsInString) {
    CleanUpType successCleanUp = new CleanUpType();
    String[] successCategories = getStringsFromArray(successCleanupsInString);
    CategoryListType categoryList = new CategoryListType();
    for (String category : successCategories) {
        Category_type1 categoryType1 = Category_type1.Factory.fromValue(category.toLowerCase());
        categoryList.addCategory(categoryType1);
    }
    successCleanUp.setOn(On_type1.success);
    successCleanUp.setCategoryList(categoryList);
    return successCleanUp;
}
Also used : Category_type1(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Category_type1) CategoryListType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CategoryListType) CleanUpType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CleanUpType)

Aggregations

CleanUpType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CleanUpType)5 CategoryListType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CategoryListType)4 Category_type1 (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Category_type1)4 CategoryListType (org.wso2.carbon.bpel.stub.mgt.types.CategoryListType)3 Category_type1 (org.wso2.carbon.bpel.stub.mgt.types.Category_type1)3 CleanUpType (org.wso2.carbon.bpel.stub.mgt.types.CleanUpType)3 CleanUpListType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.CleanUpListType)2 EnableEventListType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.EnableEventListType)2 Generate_type1 (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Generate_type1)2 ProcessEventsListType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ProcessEventsListType)2 ScopeEventListType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ScopeEventListType)2 ScopeEventType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ScopeEventType)2 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 Set (java.util.Set)1 QName (javax.xml.namespace.QName)1 TCleanup (org.apache.ode.bpel.dd.TCleanup)1 TInvoke (org.apache.ode.bpel.dd.TInvoke)1 TProvide (org.apache.ode.bpel.dd.TProvide)1 BpelEvent (org.apache.ode.bpel.evt.BpelEvent)1