Java Code Examples for org.camunda.bpm.engine.RepositoryService#createProcessDefinitionQuery()

The following examples show how to use org.camunda.bpm.engine.RepositoryService#createProcessDefinitionQuery() . 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: BlueprintBundleLocalELResolverIntegrationTest.java    From camunda-bpm-platform-osgi with Apache License 2.0 5 votes vote down vote up
@Test(timeout = 35000L)
public void shouldBeAbleToResolveBean() throws InterruptedException {
  RepositoryService repositoryService = engine.getRepositoryService();
  ProcessDefinition processDefinition = null;
  //it can take a while to deploy the process -> it's the step after registering the engine
  do {
    Thread.sleep(500L);
    ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
    processDefinition = query.processDefinitionKey("foo").singleResult();
  } while (processDefinition == null);
  ProcessInstance processInstance = engine.getRuntimeService().startProcessInstanceByKey("foo");
  assertThat(processInstance.isEnded(), is(true));
}
 
Example 2
Source File: TestResourceName.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Test
public void testResourceName() {
  ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
  Assert.assertNotNull(processEngine);

  RepositoryService repositoryService = processEngine.getRepositoryService();

  ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();

  ProcessDefinition definition = query.processDefinitionKey("process-0").singleResult();
  Assert.assertEquals("process0.bpmn", definition.getResourceName());

  definition = query.processDefinitionKey("process-1").singleResult();
  Assert.assertEquals("processes/process1.bpmn", definition.getResourceName());

  definition = query.processDefinitionKey("process-2").singleResult();
  Assert.assertEquals("process2.bpmn", definition.getResourceName());

  definition = query.processDefinitionKey("process-3").singleResult();
  Assert.assertEquals("subDirectory/process3.bpmn", definition.getResourceName());

  definition = query.processDefinitionKey("process-4").singleResult();
  Assert.assertEquals("process4.bpmn", definition.getResourceName());

  definition = query.processDefinitionKey("process-5").singleResult();
  Assert.assertEquals("subDirectory/process5.bpmn", definition.getResourceName());
}
 
Example 3
Source File: TestMultipleClasspathRoots.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Test
public void testMultipleClasspathRoots() {
  ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
  Assert.assertNotNull(processEngine);

  RepositoryService repositoryService = processEngine.getRepositoryService();

  ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();

  long count = query.count();
  Assert.assertEquals(1, count);
}