public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { return BpmPlatform.getProcessEngineService(); }
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { return BpmPlatform.getProcessEngineService(); }
public static ProcessEngine getDefaultProcessEngine() { return getProcessEngineService().getDefaultProcessEngine(); }
public static ProcessEngine getDefaultProcessEngine() { return getProcessEngineService().getDefaultProcessEngine(); }
@Produces @Named @ApplicationScoped public ProcessEngine processEngine() { ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getDefaultProcessEngine(); if(processEngine != null) { return processEngine; } else { List<ProcessEngine> processEngines = BpmPlatform.getProcessEngineService().getProcessEngines(); if (processEngines != null && processEngines.size() == 1) { return processEngines.get(0); } else { return ProcessEngines.getDefaultProcessEngine(false); } } }
@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); } }
@Before public void setEngines() { ProcessEngineService engineService = BpmPlatform.getProcessEngineService(); engine1 = engineService.getProcessEngine("engine1"); engine1Configuration = ((ProcessEngineImpl) engine1).getProcessEngineConfiguration(); }
@Before public void setEngines() { ProcessEngineService engineService = BpmPlatform.getProcessEngineService(); engine1 = engineService.getProcessEngine("engine1"); // unregister process application so that context switch cannot be performed unregisterProcessApplication(); }
@Test @OperateOnDeployment("test1") public void testNonExistingEngineRetrieval() { ProcessEngineService engineService = BpmPlatform.getProcessEngineService(); ProcessEngine engine = engineService.getProcessEngine("aNonExistingEngineName"); Assert.assertNull(engine); } }
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { return BpmPlatform.getProcessEngineService(); }
public void testDeployAppWithoutProcesses() { registerProcessEngine(); TestApplicationWithoutProcesses processApplication = new TestApplicationWithoutProcesses(); processApplication.deploy(); ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getDefaultProcessEngine(); long deployments = processEngine.getRepositoryService().createDeploymentQuery().count(); assertEquals(0, deployments); processApplication.undeploy(); }
@Override public ProcessEngine getProcessEngine(String name) { return BpmPlatform.getProcessEngineService().getProcessEngine(name); }
@Override public Set<String> getProcessEngineNames() { return BpmPlatform.getProcessEngineService().getProcessEngineNames(); }
public static ProcessEngine getDefaultProcessEngine() { return getProcessEngineService().getDefaultProcessEngine(); }
@Produces @Named @ApplicationScoped public ProcessEngine processEngine() { ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getDefaultProcessEngine(); if(processEngine != null) { return processEngine; } else { List<ProcessEngine> processEngines = BpmPlatform.getProcessEngineService().getProcessEngines(); if (processEngines != null && processEngines.size() == 1) { return processEngines.get(0); } else { return ProcessEngines.getDefaultProcessEngine(false); } } }
@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(); }
public void testDeployAppWithCustomEngine() { TestApplicationWithCustomEngine processApplication = new TestApplicationWithCustomEngine(); processApplication.deploy(); ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getProcessEngine("embeddedEngine"); assertNotNull(processEngine); assertEquals("embeddedEngine", processEngine.getName()); ProcessEngineConfiguration configuration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration(); // assert engine properties specified assertTrue(configuration.isJobExecutorDeploymentAware()); assertTrue(configuration.isJobExecutorPreferTimerJobs()); assertTrue(configuration.isJobExecutorAcquireByDueDate()); assertEquals(5, configuration.getJdbcMaxActiveConnections()); processApplication.undeploy(); }
@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); } }
public void testDeployAppWithoutProcesses() { registerProcessEngine(); TestApplicationWithoutProcesses processApplication = new TestApplicationWithoutProcesses(); processApplication.deploy(); ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getDefaultProcessEngine(); long deployments = processEngine.getRepositoryService().createDeploymentQuery().count(); assertEquals(0, deployments); processApplication.undeploy(); }
public void testDeployAppWithCustomEngine() { TestApplicationWithCustomEngine processApplication = new TestApplicationWithCustomEngine(); processApplication.deploy(); ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getProcessEngine("embeddedEngine"); assertNotNull(processEngine); assertEquals("embeddedEngine", processEngine.getName()); ProcessEngineConfiguration configuration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration(); // assert engine properties specified assertTrue(configuration.isJobExecutorDeploymentAware()); assertTrue(configuration.isJobExecutorPreferTimerJobs()); assertTrue(configuration.isJobExecutorAcquireByDueDate()); assertEquals(5, configuration.getJdbcMaxActiveConnections()); processApplication.undeploy(); }