Search in sources :

Example 6 with ProcessConf

use of org.apache.ode.bpel.iapi.ProcessConf in project carbon-business-process by wso2.

the class ProcessManagementServiceSkeleton method getProcessInfo.

public ProcessInfoType getProcessInfo(QName pid) throws ProcessManagementException {
    ProcessInfoType processInfoType = new ProcessInfoType();
    TenantProcessStoreImpl tenantProcessStore = AdminServiceUtils.getTenantProcessStore();
    ProcessConf processConf = tenantProcessStore.getProcessConfiguration(pid);
    fillProcessInfo(processInfoType, processConf, ProcessInfoCustomizer.ALL, tenantProcessStore);
    return processInfoType;
}
Also used : ProcessInfoType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.ProcessInfoType) ProcessConf(org.apache.ode.bpel.iapi.ProcessConf) TenantProcessStoreImpl(org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStoreImpl)

Example 7 with ProcessConf

use of org.apache.ode.bpel.iapi.ProcessConf in project carbon-business-process by wso2.

the class BPELBindingContextImpl method createPartnerRoleChannel.

public PartnerRoleChannel createPartnerRoleChannel(QName processId, PortType portType, Endpoint initialPartnerEndpoint) {
    ProcessConf processConfiguration = ((ProcessStore) bpelServer.getMultiTenantProcessStore()).getProcessConfiguration(processId);
    Definition wsdl = processConfiguration.getDefinitionForService(initialPartnerEndpoint.serviceName);
    if (wsdl == null) {
        throw new ContextException("Cannot find definition for service " + initialPartnerEndpoint.serviceName + " in the context of process " + processId);
    }
    return createPartnerService(processConfiguration, initialPartnerEndpoint.serviceName, initialPartnerEndpoint.portName);
}
Also used : TenantProcessStore(org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStore) ProcessStore(org.apache.ode.bpel.iapi.ProcessStore) ProcessConf(org.apache.ode.bpel.iapi.ProcessConf) Definition(javax.wsdl.Definition) ContextException(org.apache.ode.bpel.iapi.ContextException)

Example 8 with ProcessConf

use of org.apache.ode.bpel.iapi.ProcessConf in project carbon-business-process by wso2.

the class BPELBindingContextImpl method activateMyRoleEndpoint.

public EndpointReference activateMyRoleEndpoint(QName processId, Endpoint myRoleEndpoint) {
    try {
        if (log.isDebugEnabled()) {
            log.debug("Activating MyRole endpoint for process: " + processId + " endpoint: " + myRoleEndpoint);
        }
        ProcessConf processConfiguration = ((ProcessStore) bpelServer.getMultiTenantProcessStore()).getProcessConfiguration(processId);
        BPELProcessProxy processProxy = publishAxisService(processConfiguration, myRoleEndpoint.serviceName, myRoleEndpoint.portName);
        serviceEprMap.put(processProxy, processProxy.getServiceReference());
        updateServiceList(getTenantId(processId), myRoleEndpoint, STATE.ADD);
        return processProxy.getServiceReference();
    } catch (AxisFault af) {
        final String errMsg = "Could not activate endpoint for service " + myRoleEndpoint.serviceName + " and port " + myRoleEndpoint.portName;
        log.error(errMsg, af);
        throw new ContextException(errMsg, af);
    }
}
Also used : TenantProcessStore(org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStore) ProcessStore(org.apache.ode.bpel.iapi.ProcessStore) AxisFault(org.apache.axis2.AxisFault) ProcessConf(org.apache.ode.bpel.iapi.ProcessConf) ContextException(org.apache.ode.bpel.iapi.ContextException)

Example 9 with ProcessConf

use of org.apache.ode.bpel.iapi.ProcessConf in project carbon-business-process by wso2.

the class AxisServiceUtils method populateAxisService.

private static AxisService populateAxisService(BPELProcessProxy processProxy, AxisConfiguration axisConfiguration, WSDL11ToAxisServiceBuilder serviceBuilder) throws AxisFault {
    ProcessConf pConf = processProxy.getProcessConfiguration();
    AxisService axisService = serviceBuilder.populateService();
    axisService.setParent(axisConfiguration);
    axisService.setWsdlFound(true);
    axisService.setCustomWsdl(true);
    axisService.setClassLoader(axisConfiguration.getServiceClassLoader());
    URL wsdlUrl = null;
    for (File file : pConf.getFiles()) {
        if (file.getAbsolutePath().indexOf(processProxy.getWsdlDefinition().getDocumentBaseURI()) > 0) {
            try {
                wsdlUrl = file.toURI().toURL();
            } catch (MalformedURLException e) {
                String errorMessage = "Cannot convert File URI to URL.";
                handleException(pConf.getProcessId(), errorMessage, e);
            }
        }
    }
    if (wsdlUrl != null) {
        axisService.setFileName(wsdlUrl);
    }
    Utils.setEndpointsToAllUsedBindings(axisService);
    axisService.addParameter(new Parameter("useOriginalwsdl", "true"));
    axisService.addParameter(new Parameter("modifyUserWSDLPortAddress", "true"));
    axisService.addParameter(new Parameter("setEndpointsToAllUsedBindings", "true"));
    /* Setting service type to use in service management*/
    axisService.addParameter(ServerConstants.SERVICE_TYPE, "bpel");
    /* Process ID as a service parameter to use with process try-it*/
    axisService.addParameter(BPELConstants.PROCESS_ID, pConf.getProcessId());
    /* Fix for losing of security configuration  when updating BPEL package*/
    axisService.addParameter(new Parameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true"));
    return axisService;
}
Also used : MalformedURLException(java.net.MalformedURLException) ProcessConf(org.apache.ode.bpel.iapi.ProcessConf) AxisService(org.apache.axis2.description.AxisService) Parameter(org.apache.axis2.description.Parameter) File(java.io.File) URL(java.net.URL)

Example 10 with ProcessConf

use of org.apache.ode.bpel.iapi.ProcessConf in project carbon-business-process by wso2.

the class TenantProcessStoreImpl method handleUndeployOnSlaveNode.

/**
 * Undeployment scenario in a worker node( Slave ) in the clustered setup
 * When the BPELDeployer get called for undeploying the bpel package, following has already taken place.
 * The package information stored in the registry as well as the zip archive is deleted
 * Process, Instance information have been removed from the ODE database
 * However, on the slave node, the bpel process and the web services associated with the bpel process
 * is still in memory. We need to unload the bpel process and the associated web services
 *
 * @param bpelPackageName bpel package name
 * @return
 */
private int handleUndeployOnSlaveNode(String bpelPackageName) {
    List<String> packageList = findMatchingProcessByPackageName(bpelPackageName);
    if (packageList.size() < 1) {
        log.debug("Handling un-deploy operation on salve (worker) node : package list is empty");
        return -1;
    }
    for (String packageName : packageList) {
        // location for extracted BPEL package
        String bpelPackageLocation = parentProcessStore.getLocalDeploymentUnitRepo().getAbsolutePath() + File.separator + tenantId + File.separator + packageName;
        File bpelPackage = new File(bpelPackageLocation);
        // removing extracted bpel package at repository/bpel/tenantID/
        deleteBpelPackageFromRepo(bpelPackage);
        for (QName pid : getProcessesInPackage(packageName)) {
            ProcessConfigurationImpl processConf = (ProcessConfigurationImpl) getProcessConfiguration(pid);
            // This property is read when we removing the axis service for this process.
            // So that we can decide whether we should persist service QOS configs
            processConf.setUndeploying(true);
        }
    }
    Collection<QName> undeployedProcesses = new ArrayList<QName>();
    for (String nameWithVersion : packageList) {
        undeploySpecificVersionOfBPELPackage(nameWithVersion, undeployedProcesses);
    }
    BPELServerImpl instance = BPELServerImpl.getInstance();
    BpelServerImpl odeBpelServer = instance.getODEBPELServer();
    for (QName pid : undeployedProcesses) {
        odeBpelServer.unregister(pid);
        ProcessConf pConf = parentProcessStore.getProcessConfiguration(pid);
        if (pConf != null) {
            if (log.isDebugEnabled()) {
                log.debug("Cancelling all cron scheduled jobs for process " + pid);
            }
            odeBpelServer.getContexts().cronScheduler.cancelProcessCronJobs(pid, true);
        }
        log.info("Process " + pid + " un-deployed.");
    }
    parentProcessStore.updateProcessAndDUMapsForSalve(tenantId, bpelPackageName, undeployedProcesses);
    return 0;
}
Also used : BpelServerImpl(org.apache.ode.bpel.engine.BpelServerImpl) QName(javax.xml.namespace.QName) BPELServerImpl(org.wso2.carbon.bpel.core.ode.integration.BPELServerImpl) ProcessConf(org.apache.ode.bpel.iapi.ProcessConf) ArrayList(java.util.ArrayList) File(java.io.File)

Aggregations

ProcessConf (org.apache.ode.bpel.iapi.ProcessConf)12 QName (javax.xml.namespace.QName)7 ContextException (org.apache.ode.bpel.iapi.ContextException)4 Definition (javax.wsdl.Definition)3 TenantProcessStoreImpl (org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStoreImpl)3 File (java.io.File)2 MalformedURLException (java.net.MalformedURLException)2 SQLException (java.sql.SQLException)2 Map (java.util.Map)2 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)2 AxisService (org.apache.axis2.description.AxisService)2 WSDL11ToAxisServiceBuilder (org.apache.axis2.description.WSDL11ToAxisServiceBuilder)2 ProcessStore (org.apache.ode.bpel.iapi.ProcessStore)2 ProcessConfigurationImpl (org.wso2.carbon.bpel.core.ode.integration.store.ProcessConfigurationImpl)2 TenantProcessStore (org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStore)2 RegistryException (org.wso2.carbon.registry.core.exceptions.RegistryException)2 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1