Search in sources :

Example 6 with Activate

use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.

the class BPMNServiceComponent method activate.

protected void activate(ComponentContext ctxt) {
    log.info("Initializing the BPMN core component...");
    try {
        BundleContext bundleContext = ctxt.getBundleContext();
        BPMNServerHolder holder = BPMNServerHolder.getInstance();
        ActivitiEngineBuilder activitiEngineBuilder = new ActivitiEngineBuilder();
        holder.setEngine(activitiEngineBuilder.buildEngine());
        holder.setTenantManager(new TenantManager());
        /*BPMNRestExtensionHolder restHolder = BPMNRestExtensionHolder.getInstance();

            restHolder.setRestInvoker(new RESTInvoker());*/
        BPMNEngineServiceImpl bpmnEngineService = new BPMNEngineServiceImpl();
        bpmnEngineService.setProcessEngine(ActivitiEngineBuilder.getProcessEngine());
        bundleContext.registerService(BPMNEngineService.class, bpmnEngineService, null);
        bundleContext.registerService(ServerStartupObserver.class.getName(), new BPMNEngineServerStartupObserver(), null);
        bundleContext.registerService(WaitBeforeShutdownObserver.class, new BPMNEngineWaitBeforeShutdownObserver(), null);
    // DataSourceHandler dataSourceHandler = new DataSourceHandler();
    // dataSourceHandler.initDataSource(activitiEngineBuilder.getDataSourceJndiName());
    // dataSourceHandler.closeDataSource();
    // } catch (BPMNMetaDataTableCreationException e) {
    // log.error("Could not create BPMN checksum table", e);
    // } catch (DatabaseConfigurationException e) {
    // log.error("Could not create BPMN checksum table", e);
    } catch (Throwable e) {
        log.error("Failed to initialize the BPMN core component.", e);
    }
}
Also used : BPMNEngineServerStartupObserver(org.wso2.carbon.bpmn.core.integration.BPMNEngineServerStartupObserver) ServerStartupObserver(org.wso2.carbon.core.ServerStartupObserver) ActivitiEngineBuilder(org.wso2.carbon.bpmn.core.ActivitiEngineBuilder) BPMNServerHolder(org.wso2.carbon.bpmn.core.BPMNServerHolder) BPMNEngineWaitBeforeShutdownObserver(org.wso2.carbon.bpmn.core.integration.BPMNEngineWaitBeforeShutdownObserver) TenantManager(org.wso2.carbon.bpmn.core.deployment.TenantManager) BPMNEngineServerStartupObserver(org.wso2.carbon.bpmn.core.integration.BPMNEngineServerStartupObserver) BundleContext(org.osgi.framework.BundleContext)

Example 7 with Activate

use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.

the class BPMNAppDeployerDSComponent method activate.

protected void activate(ComponentContext ctxt) {
    try {
        // register bpmn deployer as an OSGi Service
        BPMNAppDeployer BPMNAppDeployer = new BPMNAppDeployer();
        appHandlerRegistration = ctxt.getBundleContext().registerService(AppDeploymentHandler.class.getName(), BPMNAppDeployer, null);
        // read required-features.xml
        URL reqFeaturesResource = ctxt.getBundleContext().getBundle().getResource(AppDeployerConstants.REQ_FEATURES_XML);
        if (reqFeaturesResource != null) {
            InputStream xmlStream = reqFeaturesResource.openStream();
            requiredFeatures = AppDeployerUtils.readRequiredFeaturs(new StAXOMBuilder(xmlStream).getDocumentElement());
        }
    } catch (Throwable e) {
        log.error("Failed to activate BPMN Application Deployer", e);
    }
}
Also used : BPMNAppDeployer(org.wso2.carbon.application.deployer.bpmn.BPMNAppDeployer) InputStream(java.io.InputStream) StAXOMBuilder(org.apache.axiom.om.impl.builder.StAXOMBuilder) URL(java.net.URL)

Example 8 with Activate

use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.

the class HumanTaskAppDeployerDSComponent method activate.

protected void activate(ComponentContext ctxt) {
    try {
        // register humantask deployer as an OSGi Service
        HumanTaskAppDeployer humanTaskAppDeployer = new HumanTaskAppDeployer();
        appHandlerRegistration = ctxt.getBundleContext().registerService(AppDeploymentHandler.class.getName(), humanTaskAppDeployer, null);
        // read required-features.xml
        URL reqFeaturesResource = ctxt.getBundleContext().getBundle().getResource(AppDeployerConstants.REQ_FEATURES_XML);
        if (reqFeaturesResource != null) {
            InputStream xmlStream = reqFeaturesResource.openStream();
            requiredFeatures = AppDeployerUtils.readRequiredFeaturs(new StAXOMBuilder(xmlStream).getDocumentElement());
        }
    } catch (Throwable e) {
        log.error("Failed to activate HumanTask Application Deployer", e);
    }
}
Also used : InputStream(java.io.InputStream) StAXOMBuilder(org.apache.axiom.om.impl.builder.StAXOMBuilder) URL(java.net.URL) HumanTaskAppDeployer(org.wso2.carbon.application.deployer.humantask.HumanTaskAppDeployer)

Example 9 with Activate

use of org.wso2.carbon.humantask.core.engine.commands.Activate 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 10 with Activate

use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.

the class BPMNExtensionsComponent method activate.

protected void activate(ComponentContext ctxt) {
    BundleContext bundleContext = ctxt.getBundleContext();
    RESTInvoker restInvoker = new RESTInvoker();
    BPMNRestExtensionHolder.getInstance().setRestInvoker(restInvoker);
    if (log.isDebugEnabled()) {
        log.debug("Activated bpmn extensions component and configured rest invoker");
    }
    bundleContext.registerService(WaitBeforeShutdownObserver.class, new RESTClientShutdownObserver(), null);
}
Also used : RESTInvoker(org.wso2.carbon.bpmn.extensions.rest.RESTInvoker) RESTClientShutdownObserver(org.wso2.carbon.bpmn.extensions.rest.RESTClientShutdownObserver) BundleContext(org.osgi.framework.BundleContext)

Aggregations

BundleContext (org.osgi.framework.BundleContext)4 InputStream (java.io.InputStream)3 URL (java.net.URL)3 StAXOMBuilder (org.apache.axiom.om.impl.builder.StAXOMBuilder)3 ServerStartupObserver (org.wso2.carbon.core.ServerStartupObserver)2 HikariDataSource (com.zaxxer.hikari.HikariDataSource)1 Hashtable (java.util.Hashtable)1 Context (javax.naming.Context)1 NamingException (javax.naming.NamingException)1 RuntimeService (org.activiti.engine.RuntimeService)1 HistoricProcessInstance (org.activiti.engine.history.HistoricProcessInstance)1 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)1 AxisFault (org.apache.axis2.AxisFault)1 ContextException (org.apache.ode.bpel.iapi.ContextException)1 ProcessConf (org.apache.ode.bpel.iapi.ProcessConf)1 ProcessStore (org.apache.ode.bpel.iapi.ProcessStore)1 Activate (org.osgi.service.component.annotations.Activate)1 Broker (org.wso2.carbon.apimgt.core.api.Broker)1 DataSource (org.wso2.carbon.apimgt.core.dao.impl.DataSource)1 DataSourceImpl (org.wso2.carbon.apimgt.core.dao.impl.DataSourceImpl)1