Search in sources :

Example 86 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.

the class SpringConfigurationHelper method buildProcessEngine.

public static ProcessEngine buildProcessEngine(URL resource) {
    log.fine("==== BUILDING SPRING APPLICATION CONTEXT AND PROCESS ENGINE =========================================");
    ApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource));
    Map<String, ProcessEngine> beansOfType = applicationContext.getBeansOfType(ProcessEngine.class);
    if ((beansOfType == null) || (beansOfType.isEmpty())) {
        throw new ProcessEngineException("no " + ProcessEngine.class.getName() + " defined in the application context " + resource.toString());
    }
    ProcessEngine processEngine = beansOfType.values().iterator().next();
    log.fine("==== SPRING PROCESS ENGINE CREATED ==================================================================");
    return processEngine;
}
Also used : GenericXmlApplicationContext(org.springframework.context.support.GenericXmlApplicationContext) ApplicationContext(org.springframework.context.ApplicationContext) UrlResource(org.springframework.core.io.UrlResource) GenericXmlApplicationContext(org.springframework.context.support.GenericXmlApplicationContext) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 87 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.

the class SpringTransactionsProcessEngineConfiguration method buildProcessEngine.

@Override
public ProcessEngine buildProcessEngine() {
    ProcessEngine processEngine = super.buildProcessEngine();
    autoDeployResources(processEngine);
    return processEngine;
}
Also used : ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 88 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.

the class ProcessApplicationDeploymentService method performUndeployment.

protected void performUndeployment() {
    final ProcessEngine processEngine = processEngineInjector.getValue();
    try {
        if (deployment != null) {
            // always unregister
            Set<String> deploymentIds = deployment.getProcessApplicationRegistration().getDeploymentIds();
            processEngine.getManagementService().unregisterProcessApplication(deploymentIds, true);
        }
    } catch (Exception e) {
        LOGGER.log(Level.SEVERE, "Exception while unregistering process application with the process engine.");
    }
    // delete the deployment only if requested in metadata
    if (deployment != null && PropertyHelper.getBooleanProperty(processArchive.getProperties(), ProcessArchiveXml.PROP_IS_DELETE_UPON_UNDEPLOY, false)) {
        try {
            LOGGER.info("Deleting cascade deployment with name '" + deployment.getName() + "/" + deployment.getId() + "'.");
            // always cascade & skip custom listeners
            processEngine.getRepositoryService().deleteDeployment(deployment.getId(), true, true);
        } catch (Exception e) {
            LOGGER.log(Level.WARNING, "Exception while deleting process engine deployment", e);
        }
    }
}
Also used : StartException(org.jboss.msc.service.StartException) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 89 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.

the class ProcessEngineAdd method installService.

protected ServiceController<ProcessEngine> installService(OperationContext context, ServiceVerificationHandler verificationHandler, ManagedProcessEngineMetadata processEngineConfiguration) {
    MscManagedProcessEngineController service = new MscManagedProcessEngineController(processEngineConfiguration);
    ServiceName name = ServiceNames.forManagedProcessEngine(processEngineConfiguration.getEngineName());
    ServiceBuilder<ProcessEngine> serviceBuilder = context.getServiceTarget().addService(name, service);
    MscManagedProcessEngineController.initializeServiceBuilder(processEngineConfiguration, service, serviceBuilder, processEngineConfiguration.getJobExecutorAcquisitionName());
    serviceBuilder.addListener(verificationHandler);
    return serviceBuilder.install();
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) MscManagedProcessEngineController(org.camunda.bpm.container.impl.jboss.service.MscManagedProcessEngineController) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 90 with ProcessEngine

use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.

the class ProcessEngineAdd method performRuntime.

@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
    String engineName = PathAddress.pathAddress(operation.get(ADDRESS)).getLastElement().getValue();
    ManagedProcessEngineMetadata processEngineConfiguration = transformConfiguration(context, engineName, model);
    ServiceController<ProcessEngine> controller = installService(context, verificationHandler, processEngineConfiguration);
    newControllers.add(controller);
}
Also used : ManagedProcessEngineMetadata(org.camunda.bpm.container.impl.jboss.config.ManagedProcessEngineMetadata) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Aggregations

ProcessEngine (org.camunda.bpm.engine.ProcessEngine)162 DescribesScenario (org.camunda.bpm.qa.upgrade.DescribesScenario)60 ScenarioSetup (org.camunda.bpm.qa.upgrade.ScenarioSetup)60 Task (org.camunda.bpm.engine.task.Task)52 Times (org.camunda.bpm.qa.upgrade.Times)52 Test (org.junit.Test)26 ExtendsScenario (org.camunda.bpm.qa.upgrade.ExtendsScenario)18 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)17 ArrayList (java.util.ArrayList)16 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)15 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)14 AbstractFoxPlatformIntegrationTest (org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)14 RepositoryService (org.camunda.bpm.engine.RepositoryService)13 PooledDataSource (org.apache.ibatis.datasource.pooled.PooledDataSource)7 StandaloneInMemProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)6 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)5 Job (org.camunda.bpm.engine.runtime.Job)5 Connection (java.sql.Connection)4 CaseService (org.camunda.bpm.engine.CaseService)4 StandaloneProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration)4