Java Code Examples for org.camunda.bpm.BpmPlatform#getProcessEngineService()

The following examples show how to use org.camunda.bpm.BpmPlatform#getProcessEngineService() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NamedProcessEngineServicesProducer.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Produces @ProcessEngineName("")
public ProcessEngine processEngine(InjectionPoint ip) {

  ProcessEngineName annotation = ip.getAnnotated().getAnnotation(ProcessEngineName.class);
  String processEngineName = annotation.value();
  if(processEngineName == null || processEngineName.length() == 0) {
   throw new ProcessEngineException("Cannot determine which process engine to inject: @ProcessEngineName must specify the name of a process engine.");
  }
  try {
    ProcessEngineService processEngineService = BpmPlatform.getProcessEngineService();
    return processEngineService.getProcessEngine(processEngineName);
  }catch (Exception e) {
    throw new ProcessEngineException("Cannot find process engine named '"+processEngineName+"' specified using @ProcessEngineName: "+e.getMessage(), e);
  }

}
 
Example 2
Source File: AbstractFoxPlatformIntegrationTest.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Before
public void setupBeforeTest() {
  processEngineService = BpmPlatform.getProcessEngineService();
  processEngine = processEngineService.getDefaultProcessEngine();
  processEngineConfiguration = ((ProcessEngineImpl)processEngine).getProcessEngineConfiguration();
  processEngineConfiguration.getJobExecutor().shutdown(); // make sure the job executor is down
  formService = processEngine.getFormService();
  historyService = processEngine.getHistoryService();
  identityService = processEngine.getIdentityService();
  managementService = processEngine.getManagementService();
  repositoryService = processEngine.getRepositoryService();
  runtimeService = processEngine.getRuntimeService();
  taskService = processEngine.getTaskService();
  caseService = processEngine.getCaseService();
  decisionService = processEngine.getDecisionService();
}
 
Example 3
Source File: ProcessEngineServiceTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Test
@OperateOnDeployment("test1")
public void testNonExistingEngineRetrieval() {
  
  ProcessEngineService engineService = BpmPlatform.getProcessEngineService();
  ProcessEngine engine = engineService.getProcessEngine("aNonExistingEngineName");
  Assert.assertNull(engine);
}
 
Example 4
Source File: JobPrioritizationFailureJavaSerializationTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Before
public void setEngines() {
  ProcessEngineService engineService = BpmPlatform.getProcessEngineService();
  engine1 = engineService.getProcessEngine("engine1");

  // unregister process application so that context switch cannot be performed
  unregisterProcessApplication();
}
 
Example 5
Source File: ProcessEngineServiceObjectFactory.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
  return BpmPlatform.getProcessEngineService();
}
 
Example 6
Source File: IndependentJobExecutionTest.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@Before
public void setEngines() {
  ProcessEngineService engineService = BpmPlatform.getProcessEngineService();
  engine1 = engineService.getProcessEngine("engine1");
  engine1Configuration = ((ProcessEngineImpl) engine1).getProcessEngineConfiguration();
}