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;
}
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;
}
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);
}
}
}
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();
}
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);
}
Aggregations