use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class TestResourceName method testResourceName.
@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());
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class TestPaAsEjbJar method testPaAsEjbModule.
@Test
public void testPaAsEjbModule() {
ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
Assert.assertNotNull(processEngine);
runtimeService.startProcessInstanceByKey("paAsEjbJar-process");
Assert.assertEquals(1, runtimeService.createProcessInstanceQuery().count());
waitForJobExecutorToProcessAllJobs();
Assert.assertEquals(0, runtimeService.createProcessInstanceQuery().count());
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class NestedParallelNonInterruptingEventSubprocessScenario method completeSubprocessTask.
@DescribesScenario("init.innerTask")
@ExtendsScenario("init")
@Times(5)
public static ScenarioSetup completeSubprocessTask() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
Task task = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).taskDefinitionKey("innerTask").singleResult();
engine.getTaskService().complete(task.getId());
}
};
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class TestProcessEngineJndiBinding_JBOSS method testDefaultProcessEngineBindingCreated.
@Test
public void testDefaultProcessEngineBindingCreated() {
try {
ProcessEngine processEngine = InitialContext.doLookup("java:global/camunda-bpm-platform/process-engine/default");
Assert.assertNotNull("Process engine must not be null", processEngine);
} catch (Exception e) {
Assert.fail("Process Engine not bound in JNDI.");
}
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class TestJobExecutorActivateFalse_JBOSS method shouldNotActiateJobExecutor.
@Test
public void shouldNotActiateJobExecutor() {
ProcessEngine processEngine = processEngineService.getProcessEngine("jobExecutorActivate-FALSE-engine");
ProcessEngineConfiguration configuration = processEngine.getProcessEngineConfiguration();
JobExecutor jobExecutor = ((ProcessEngineConfigurationImpl) configuration).getJobExecutor();
assertFalse(jobExecutor.isActive());
processEngine = processEngineService.getProcessEngine("jobExecutorActivate-UNDEFINED-engine");
configuration = processEngine.getProcessEngineConfiguration();
jobExecutor = ((ProcessEngineConfigurationImpl) configuration).getJobExecutor();
assertTrue(jobExecutor.isActive());
}
Aggregations