Java Code Examples for org.camunda.bpm.engine.ProcessEngines#getProcessEngine()

The following examples show how to use org.camunda.bpm.engine.ProcessEngines#getProcessEngine() . 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: ConcurrentProcessEngineJobExecutorHistoryCleanupJobTest.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Override
protected void closeDownProcessEngine() {
  super.closeDownProcessEngine();
  final ProcessEngine otherProcessEngine = ProcessEngines.getProcessEngine(PROCESS_ENGINE_NAME);
  if (otherProcessEngine != null) {

    ((ProcessEngineConfigurationImpl)otherProcessEngine.getProcessEngineConfiguration()).getCommandExecutorTxRequired().execute(new Command<Void>() {
      public Void execute(CommandContext commandContext) {

        List<Job> jobs = otherProcessEngine.getManagementService().createJobQuery().list();
        if (jobs.size() > 0) {
          assertEquals(1, jobs.size());
          String jobId = jobs.get(0).getId();
          commandContext.getJobManager().deleteJob((JobEntity) jobs.get(0));
          commandContext.getHistoricJobLogManager().deleteHistoricJobLogByJobId(jobId);
        }

        return null;
      }
    });

    otherProcessEngine.close();
    ProcessEngines.unregister(otherProcessEngine);
  }
}
 
Example 2
Source File: AbstractContextCacheTest.java    From camunda-bpm-spring-boot-starter with Apache License 2.0 5 votes vote down vote up
@Test
public void testEngineRegistration()
{
  // do
  ProcessEngine registeredEngine = ProcessEngines.getProcessEngine("default");
  assertThat(registeredEngine).isNotSameAs(processEngine);
}
 
Example 3
Source File: AbstractContextCacheTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Test
public void testEngineRegistration()
{
  // do
  ProcessEngine registeredEngine = ProcessEngines.getProcessEngine("default");
  assertThat(registeredEngine).isNotSameAs(processEngine);
}
 
Example 4
Source File: ProcessEnginesTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public void testProcessEngineInfo() {

    List<ProcessEngineInfo> processEngineInfos = ProcessEngines.getProcessEngineInfos();
    assertEquals(1, processEngineInfos.size());

    ProcessEngineInfo processEngineInfo = processEngineInfos.get(0);
    assertNull(processEngineInfo.getException());
    assertNotNull(processEngineInfo.getName());
    assertNotNull(processEngineInfo.getResourceUrl());

    ProcessEngine processEngine = ProcessEngines.getProcessEngine(ProcessEngines.NAME_DEFAULT);
    assertNotNull(processEngine);
  }
 
Example 5
Source File: SpringBootProcessEngineProvider.java    From camunda-bpm-spring-boot-starter with Apache License 2.0 4 votes vote down vote up
@Override
public ProcessEngine getProcessEngine(String name) {
  return ProcessEngines.getProcessEngine(name);
}
 
Example 6
Source File: SpringBootProcessEngineProvider.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@Override
public ProcessEngine getProcessEngine(String name) {
  return ProcessEngines.getProcessEngine(name);
}
 
Example 7
Source File: ContainerManagedProcessEngineProvider.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@Override
public ProcessEngine getProcessEngine(String name) {
  return ProcessEngines.getProcessEngine(name);
}