org.flowable.engine.ProcessEngine Java Examples
The following examples show how to use
org.flowable.engine.ProcessEngine.
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: MuleHttpBasicAuthTest.java From flowable-engine with Apache License 2.0 | 6 votes |
@Test public void httpWithBasicAuth() throws Exception { Assert.assertTrue(muleContext.isStarted()); ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); Deployment deployment = processEngine.getRepositoryService() .createDeployment() .addClasspathResource("org/activiti/mule/testHttpBasicAuth.bpmn20.xml") .deploymentProperty(DeploymentProperties.DEPLOY_AS_FLOWABLE5_PROCESS_DEFINITION, Boolean.TRUE) .deploy(); RuntimeService runtimeService = processEngine.getRuntimeService(); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("muleProcess"); Assert.assertFalse(processInstance.isEnded()); Object result = runtimeService.getVariable(processInstance.getProcessInstanceId(), "theVariable"); Assert.assertEquals(10, result); runtimeService.deleteProcessInstance(processInstance.getId(), "test"); processEngine.getHistoryService().deleteHistoricProcessInstance(processInstance.getId()); processEngine.getRepositoryService().deleteDeployment(deployment.getId()); assertAndEnsureCleanDb(processEngine); ProcessEngines.destroy(); }
Example #2
Source File: ProcessAsyncHistoryExecutorTest.java From flowable-engine with Apache License 2.0 | 6 votes |
@Test public void asyncHistoryExecutorBeanWithDefault() { contextRunner .run((context -> { assertThat(context).doesNotHaveBean("asyncHistoryExecutor"); AsyncExecutor processAsyncHistoryExecutor = context.getBean(ProcessEngine.class).getProcessEngineConfiguration().getAsyncHistoryExecutor(); assertThat(processAsyncHistoryExecutor).isNull(); assertThat(context.getBean(ProcessEngine.class).getProcessEngineConfiguration().isAsyncHistoryExecutorActivate()).isTrue(); assertThat(((ProcessEngineConfigurationImpl) context.getBean(ProcessEngine.class).getProcessEngineConfiguration()).isAsyncHistoryEnabled()) .isFalse(); })); }
Example #3
Source File: SingleResourceAutoDeploymentStrategy.java From flowable-engine with Apache License 2.0 | 6 votes |
@Override protected void deployResourcesInternal(String deploymentNameHint, Resource[] resources, ProcessEngine engine) { // Create a separate deployment for each resource using the resource name RepositoryService repositoryService = engine.getRepositoryService(); for (final Resource resource : resources) { final String resourceName = determineResourceName(resource); final DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(resourceName); addResource(resource, resourceName, deploymentBuilder); try { deploymentBuilder.deploy(); } catch (RuntimeException e) { if (isThrowExceptionOnDeploymentFailure()) { throw e; } else { LOGGER.warn( "Exception while autodeploying process definitions for resource {}. This exception can be ignored if the root cause indicates a unique constraint violation, which is typically caused by two (or more) servers booting up at the exact same time and deploying the same definitions. ", resource, e); } } } }
Example #4
Source File: AbstractMuleTest.java From flowable-engine with Apache License 2.0 | 6 votes |
/** * Each test is assumed to clean up all DB content it entered. After a test method executed, this method scans all tables to see if the DB is completely clean. It throws AssertionFailed in case * the DB is not clean. If the DB is not clean, it is cleaned by performing a create a drop. */ protected void assertAndEnsureCleanDb(ProcessEngine processEngine) throws Exception { EnsureCleanDbUtils.assertAndEnsureCleanDb( getClass().getSimpleName() + "." + name.getMethodName(), LOGGER, processEngine.getProcessEngineConfiguration(), TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK, true, new Command<Void>() { @Override public Void execute(CommandContext commandContext) { SchemaManager schemaManager = CommandContextUtil.getProcessEngineConfiguration(commandContext).getSchemaManager(); schemaManager.schemaDrop(); schemaManager.schemaCreate(); return null; } } ); }
Example #5
Source File: MuleVMTest.java From flowable-engine with Apache License 2.0 | 6 votes |
@Test public void send() throws Exception { Assert.assertTrue(muleContext.isStarted()); ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); RepositoryService repositoryService = processEngine.getRepositoryService(); Deployment deployment = repositoryService.createDeployment() .addClasspathResource("org/activiti/mule/testVM.bpmn20.xml") .deploymentProperty(DeploymentProperties.DEPLOY_AS_FLOWABLE5_PROCESS_DEFINITION, Boolean.TRUE) .deploy(); RuntimeService runtimeService = processEngine.getRuntimeService(); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("muleProcess"); Assert.assertFalse(processInstance.isEnded()); Object result = runtimeService.getVariable(processInstance.getProcessInstanceId(), "theVariable"); Assert.assertEquals(30, result); runtimeService.deleteProcessInstance(processInstance.getId(), "test"); processEngine.getHistoryService().deleteHistoricProcessInstance(processInstance.getId()); repositoryService.deleteDeployment(deployment.getId()); assertAndEnsureCleanDb(processEngine); ProcessEngines.destroy(); }
Example #6
Source File: EngineEventsTest.java From flowable-engine with Apache License 2.0 | 6 votes |
@Test public void testEngineEventsTest() { ProcessEngineConfiguration processEngineConfiguration = StandaloneProcessEngineConfiguration .createProcessEngineConfigurationFromResource("org/flowable/standalone/event/flowable-eventlistener.cfg.xml"); ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine(); // Fetch the listener to check received events TestFlowableEventListener listener = (TestFlowableEventListener) processEngineConfiguration.getBeans().get("eventListener"); assertThat(listener).isNotNull(); // Check create-event assertThat(listener.getEventsReceived().get(0).getType()).isEqualTo(FlowableEngineEventType.ENGINE_CREATED); listener.clearEventsReceived(); // Check close-event processEngine.close(); assertThat(listener.getEventsReceived().get(listener.getEventsReceived().size() - 1).getType()).isEqualTo(FlowableEngineEventType.ENGINE_CLOSED); }
Example #7
Source File: AppEngineAutoConfigurationTest.java From flowable-engine with Apache License 2.0 | 6 votes |
@Test public void appEngineWithProcessEngineAndTaskIdGenerator() { contextRunner.withUserConfiguration(CustomIdGeneratorConfiguration.class ).withConfiguration(AutoConfigurations.of( ProcessEngineServicesAutoConfiguration.class, ProcessEngineAutoConfiguration.class )).run(context -> { ProcessEngine processEngine = context.getBean(ProcessEngine.class); ProcessEngineConfiguration processEngineConfiguration = processEngine.getProcessEngineConfiguration(); assertThat(processEngineConfiguration.getIdGenerator().getNextId()).as("Process id generator must be DB id generator").doesNotContain("-"); AppEngine appEngine = context.getBean(AppEngine.class); deleteDeployments(appEngine); deleteDeployments(processEngine); }); }
Example #8
Source File: ForceCloseMybatisConnectionPoolTest.java From flowable-engine with Apache License 2.0 | 6 votes |
@Test public void testForceCloseMybatisConnectionPoolTrue() { // given // that the process engine is configured with forceCloseMybatisConnectionPool = true StandaloneInMemProcessEngineConfiguration standaloneInMemProcessEngineConfiguration = new StandaloneInMemProcessEngineConfiguration(); standaloneInMemProcessEngineConfiguration.setJdbcUrl("jdbc:h2:mem:flowable-bpmn-" + this.getClass().getName()); standaloneInMemProcessEngineConfiguration.setForceCloseMybatisConnectionPool(true); ProcessEngine processEngine = standaloneInMemProcessEngineConfiguration.buildProcessEngine(); PooledDataSource pooledDataSource = (PooledDataSource) standaloneInMemProcessEngineConfiguration.getDataSource(); PoolState state = pooledDataSource.getPoolState(); assertThat(state.getIdleConnectionCount()).isGreaterThan(0); // then // if the process engine is closed processEngine.close(); // the idle connections are closed assertThat(state.getIdleConnectionCount()).isZero(); }
Example #9
Source File: MuleHttpTest.java From flowable-engine with Apache License 2.0 | 6 votes |
@Test public void http() throws Exception { Assert.assertTrue(muleContext.isStarted()); ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); Deployment deployment = processEngine.getRepositoryService().createDeployment() .addClasspathResource("org/activiti/mule/testHttp.bpmn20.xml") .deploymentProperty(DeploymentProperties.DEPLOY_AS_FLOWABLE5_PROCESS_DEFINITION, Boolean.TRUE) .deploy(); RuntimeService runtimeService = processEngine.getRuntimeService(); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("muleProcess"); Assert.assertFalse(processInstance.isEnded()); Object result = runtimeService.getVariable(processInstance.getProcessInstanceId(), "theVariable"); Assert.assertEquals(20, result); runtimeService.deleteProcessInstance(processInstance.getId(), "test"); processEngine.getHistoryService().deleteHistoricProcessInstance(processInstance.getId()); processEngine.getRepositoryService().deleteDeployment(deployment.getId()); assertAndEnsureCleanDb(processEngine); ProcessEngines.destroy(); }
Example #10
Source File: ProcessTimeCalculatorTest.java From multiapps-controller with Apache License 2.0 | 6 votes |
@Before public void setUp() { MockitoAnnotations.initMocks(this); Mockito.when(flowableFacade.getHistoricProcessById(DEFAULT_PROCESS_ID)) .thenReturn(mockedProcessInstance); ProcessEngine processEngine = Mockito.mock(ProcessEngine.class); Mockito.when(flowableFacade.getProcessEngine()) .thenReturn(processEngine); HistoryService historyServiceMock = Mockito.mock(HistoryService.class); Mockito.when(processEngine.getHistoryService()) .thenReturn(historyServiceMock); Mockito.when(historyServiceMock.createHistoricActivityInstanceQuery()) .thenReturn(historicActivityInstanceQueryMock); Mockito.when(historicActivityInstanceQueryMock.processInstanceId(DEFAULT_PROCESS_ID)) .thenReturn(historicActivityInstanceQueryMock); processTimeCalculator = new ProcessTimeCalculator(flowableFacade); }
Example #11
Source File: IdmEngineAutoConfigurationTest.java From flowable-engine with Apache License 2.0 | 5 votes |
@Test public void standaloneIdmEngineWithBasicDataSource() { contextRunner.run(context -> { assertThat(context) .doesNotHaveBean(AppEngine.class) .doesNotHaveBean(ProcessEngine.class) .doesNotHaveBean("idmProcessEngineConfigurationConfigurer") .doesNotHaveBean("idmAppEngineConfigurationConfigurer"); IdmEngine idmEngine = context.getBean(IdmEngine.class); assertThat(idmEngine).as("Idm engine").isNotNull(); assertAllServicesPresent(context, idmEngine); assertThat(context).hasSingleBean(CustomUserEngineConfigurerConfiguration.class) .hasSingleBean(PasswordEncoder.class) .getBean(CustomUserEngineConfigurerConfiguration.class) .satisfies(configuration -> { assertThat(configuration.getInvokedConfigurations()) .containsExactly( SpringIdmEngineConfiguration.class ); }); org.flowable.idm.api.PasswordEncoder flowablePasswordEncoder = idmEngine.getIdmEngineConfiguration().getPasswordEncoder(); PasswordEncoder passwordEncoder = context.getBean(PasswordEncoder.class); assertThat(flowablePasswordEncoder) .isInstanceOfSatisfying(SpringEncoder.class, springEncoder -> { assertThat(springEncoder.getSpringEncodingProvider()).isEqualTo(passwordEncoder); }); assertThat(passwordEncoder).isInstanceOf(NoOpPasswordEncoder.class); }); }
Example #12
Source File: SpringConfigurationHelper.java From flowable-engine with Apache License 2.0 | 5 votes |
public static ProcessEngine buildProcessEngine(URL resource) { LOGGER.debug("==== BUILDING SPRING APPLICATION CONTEXT AND PROCESS ENGINE ========================================="); try (GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource))) { Map<String, ProcessEngine> beansOfType = applicationContext.getBeansOfType(ProcessEngine.class); if ((beansOfType == null) || beansOfType.isEmpty()) { throw new FlowableException("no " + ProcessEngine.class.getName() + " defined in the application context " + resource); } ProcessEngine processEngine = beansOfType.values().iterator().next(); LOGGER.debug("==== SPRING PROCESS ENGINE CREATED =================================================================="); return processEngine; } }
Example #13
Source File: SimulationRunContext.java From flowable-engine with Apache License 2.0 | 5 votes |
public static RuntimeService getRuntimeService() { Stack<ProcessEngine> stack = getStack(processEngineThreadLocal); if (stack.isEmpty()) { return null; } return stack.peek().getRuntimeService(); }
Example #14
Source File: SimulationRunContext.java From flowable-engine with Apache License 2.0 | 5 votes |
public static TaskService getTaskService() { Stack<ProcessEngine> stack = getStack(processEngineThreadLocal); if (stack.isEmpty()) { return null; } return stack.peek().getTaskService(); }
Example #15
Source File: SpringProcessEngineConfiguration.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override public ProcessEngine buildProcessEngine() { ProcessEngine processEngine = super.buildProcessEngine(); ProcessEngines.setInitialized(true); enginesBuild.add(processEngine.getName()); return processEngine; }
Example #16
Source File: FlowableConfiguration.java From multiapps-controller with Apache License 2.0 | 5 votes |
@Inject @Bean @DependsOn("coreChangelog") public ProcessEngine processEngine(ApplicationContext applicationContext, SpringProcessEngineConfiguration processEngineConfiguration) throws Exception { ProcessEngineFactoryBean processEngineFactoryBean = new ProcessEngineFactoryBean(); processEngineFactoryBean.setApplicationContext(applicationContext); processEngineFactoryBean.setProcessEngineConfiguration(processEngineConfiguration); return processEngineFactoryBean.getObject(); }
Example #17
Source File: ProcessAndCmmnEngineAsyncExecutorTest.java From flowable-engine with Apache License 2.0 | 5 votes |
@Test public void cmmnAndProcessEngineShouldUseDistinctTaskExecutorsWhenPrimaryIsPresent() { contextRunner.withUserConfiguration(DedicatedTaskExecutorsConfiguration.class, PrimaryTaskExecutorConfiguration.class) .run((context -> { AsyncExecutor processAsyncExecutor = context.getBean(ProcessEngine.class).getProcessEngineConfiguration().getAsyncExecutor(); AsyncExecutor cmmnAsyncExecutor = context.getBean(CmmnEngine.class).getCmmnEngineConfiguration().getAsyncExecutor(); assertThat(context) .doesNotHaveBean("taskExecutor") .hasBean("primaryTaskExecutor") .hasBean("cmmnTaskExecutor") .hasBean("processTaskExecutor"); TaskExecutor primaryTaskExecutorBean = context.getBean("primaryTaskExecutor", TaskExecutor.class); TaskExecutor cmmnTaskExecutorBean = context.getBean("cmmnTaskExecutor", TaskExecutor.class); TaskExecutor processTaskExecutorBean = context.getBean("processTaskExecutor", TaskExecutor.class); assertThat(((SpringAsyncExecutor) processAsyncExecutor).getTaskExecutor()) .as("Process Async Task Executor") .isSameAs(processTaskExecutorBean) .isNotSameAs(((SpringAsyncExecutor) cmmnAsyncExecutor).getTaskExecutor()) .as("Process Async Task Executor with primary") .isNotSameAs(primaryTaskExecutorBean); assertThat(((SpringAsyncExecutor) cmmnAsyncExecutor).getTaskExecutor()) .as("Cmmn Async Task Executor") .isSameAs(cmmnTaskExecutorBean) .as("Cmmn Async Task Executor with primary") .isNotSameAs(primaryTaskExecutorBean); })); }
Example #18
Source File: ProcessEngineAutoConfigurationTest.java From flowable-engine with Apache License 2.0 | 5 votes |
@Test public void processEngineWithMultipleCustomIdGeneratorsAndAQualifiedProcessOneAsBean() { contextRunner.withUserConfiguration( CustomBeanIdGeneratorConfiguration.class, SecondCustomBeanIdGeneratorConfiguration.class, ProcessQualifiedCustomBeanIdGeneratorConfiguration.class ).run(context -> { assertThat(context) .as("Process engine").hasSingleBean(ProcessEngine.class) .as("Custom Id generator").hasBean("customIdGenerator") .as("Second Custom Id generator").hasBean("secondCustomIdGenerator") .as("Process Custom Id generator").hasBean("processQualifiedCustomIdGenerator"); Map<String, IdGenerator> idGenerators = context.getBeansOfType(IdGenerator.class); assertThat(idGenerators).containsOnlyKeys( "customIdGenerator", "secondCustomIdGenerator", "processQualifiedCustomIdGenerator" ); IdGenerator customIdGenerator = idGenerators.get("customIdGenerator"); assertThat(customIdGenerator).isInstanceOf(DbIdGenerator.class); IdGenerator secondCustomIdGenerator = idGenerators.get("secondCustomIdGenerator"); assertThat(secondCustomIdGenerator).isInstanceOf(StrongUuidGenerator.class); IdGenerator processCustomIdGenerator = idGenerators.get("processQualifiedCustomIdGenerator"); assertThat(processCustomIdGenerator).isInstanceOf(StrongUuidGenerator.class); ProcessEngine processEngine = context.getBean(ProcessEngine.class); ProcessEngineConfiguration engineConfiguration = processEngine.getProcessEngineConfiguration(); assertThat(engineConfiguration.getIdGenerator()) .isInstanceOf(StrongUuidGenerator.class) .isNotEqualTo(customIdGenerator) .isNotEqualTo(secondCustomIdGenerator) .isEqualTo(processCustomIdGenerator); }); }
Example #19
Source File: ProcessEngineLookupForTestsuite.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override public ProcessEngine getProcessEngine() { if (processEngine == null) { processEngine = ProcessEngines.getDefaultProcessEngine(); } return processEngine; }
Example #20
Source File: ContentEngineServicesAutoConfiguration.java From flowable-engine with Apache License 2.0 | 5 votes |
@Bean public ContentEngine contentEngine(@SuppressWarnings("unused") ProcessEngine processEngine) { // The process engine needs to be injected, as otherwise it won't be initialized, which means that the ContentEngine is not initialized yet if (!ContentEngines.isInitialized()) { throw new IllegalStateException("Content engine has not been initialized"); } return ContentEngines.getDefaultContentEngine(); }
Example #21
Source File: CamelCdiTestProcessEngineLookup.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override public ProcessEngine getProcessEngine() { if (processEngine == null) { processEngine = ProcessEngines.getDefaultProcessEngine(); } return processEngine; }
Example #22
Source File: EventRegistryDataChangeDetectorTest.java From flowable-engine with Apache License 2.0 | 5 votes |
protected ProcessEngine initOtherProcessEngine() { return ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("flowable.cfg.xml") // same datasource .setEngineName("otherEngine") .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE) .buildProcessEngine(); }
Example #23
Source File: TestHelper.java From flowable-engine with Apache License 2.0 | 5 votes |
/** * Each test is assumed to clean up all DB content it entered. After a test method executed, this method scans all tables to see if the DB is completely clean. It throws AssertionFailed in case * the DB is not clean. If the DB is not clean, it is cleaned by performing a create a drop. */ public static void assertAndEnsureCleanDb(ProcessEngine processEngine) { LOGGER.debug("verifying that db is clean after test"); Map<String, Long> tableCounts = processEngine.getManagementService().getTableCount(); StringBuilder outputMessage = new StringBuilder(); for (String tableName : tableCounts.keySet()) { if (!TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK.contains(tableName)) { Long count = tableCounts.get(tableName); if (count != 0L) { outputMessage.append(" ").append(tableName).append(": ").append(count).append(" record(s) "); } } } if (outputMessage.length() > 0) { outputMessage.insert(0, "DB NOT CLEAN: \n"); LOGGER.error(EMPTY_LINE); LOGGER.error(outputMessage.toString()); ((ProcessEngineImpl) processEngine) .getProcessEngineConfiguration().getCommandExecutor() .execute(new Command<Object>() { public Object execute(CommandContext commandContext) { SchemaManager schemaManager = CommandContextUtil.getProcessEngineConfiguration(commandContext).getSchemaManager(); schemaManager.schemaDrop(); schemaManager.schemaCreate(); return null; } }); throw new AssertionError(outputMessage.toString()); } }
Example #24
Source File: ActivitiMockSupport.java From flowable-engine with Apache License 2.0 | 5 votes |
public ActivitiMockSupport(ProcessEngine processEngine) { ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration(); org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl activiti5ProcessEngineConfiguration = (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) processEngineConfiguration.getFlowable5CompatibilityHandler() .getRawProcessConfiguration(); ActivityBehaviorFactory existingActivityBehaviorFactory = activiti5ProcessEngineConfiguration.getActivityBehaviorFactory(); this.testActivityBehaviorFactory = new TestActivityBehaviorFactory(existingActivityBehaviorFactory); activiti5ProcessEngineConfiguration.setActivityBehaviorFactory(testActivityBehaviorFactory); activiti5ProcessEngineConfiguration.getBpmnParser().setActivityBehaviorFactory(testActivityBehaviorFactory); }
Example #25
Source File: FlowableExtension.java From flowable-engine with Apache License 2.0 | 5 votes |
protected ProcessEngine lookupProcessEngine(BeanManager beanManager) { ServiceLoader<ProcessEngineLookup> processEngineServiceLoader = ServiceLoader.load(ProcessEngineLookup.class); Iterator<ProcessEngineLookup> serviceIterator = processEngineServiceLoader.iterator(); List<ProcessEngineLookup> discoveredLookups = new ArrayList<>(); while (serviceIterator.hasNext()) { ProcessEngineLookup serviceInstance = serviceIterator.next(); discoveredLookups.add(serviceInstance); } Collections.sort(discoveredLookups, new Comparator<ProcessEngineLookup>() { @Override public int compare(ProcessEngineLookup o1, ProcessEngineLookup o2) { return (-1) * ((Integer) o1.getPrecedence()).compareTo(o2.getPrecedence()); } }); ProcessEngine processEngine = null; for (ProcessEngineLookup processEngineLookup : discoveredLookups) { processEngine = processEngineLookup.getProcessEngine(); if (processEngine != null) { this.processEngineLookup = processEngineLookup; LOGGER.debug("ProcessEngineLookup service {} returned process engine.", processEngineLookup.getClass()); break; } else { LOGGER.debug("ProcessEngineLookup service {} returned 'null' value.", processEngineLookup.getClass()); } } if (processEngineLookup == null) { throw new FlowableException("Could not find an implementation of the org.flowable.cdi.spi.ProcessEngineLookup service " + "returning a non-null processEngine. Giving up."); } FlowableServices services = ProgrammaticBeanLookup.lookup(FlowableServices.class, beanManager); services.setProcessEngine(processEngine); return processEngine; }
Example #26
Source File: SpringFlowableTestCase.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void initializeProcessEngine() { ContextConfiguration contextConfiguration = getClass().getAnnotation(ContextConfiguration.class); String[] value = contextConfiguration.value(); boolean hasOneArg = value != null && value.length == 1; String key = hasOneArg ? value[0] : ProcessEngine.class.getName(); ProcessEngine engine = this.cachedProcessEngines.containsKey(key) ? this.cachedProcessEngines.get(key) : this.applicationContext.getBean(ProcessEngine.class); this.cachedProcessEngines.put(key, engine); this.processEngine = engine; }
Example #27
Source File: InternalFlowableExtension.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override public void beforeEach(ExtensionContext context) { ProcessEngine processEngine = getProcessEngine(context); AnnotationSupport.findAnnotation(context.getTestMethod(), Deployment.class) .ifPresent(deployment -> { String deploymentIdFromDeploymentAnnotation = TestHelper .annotationDeploymentSetUp(processEngine, context.getRequiredTestClass(), context.getRequiredTestMethod(), deployment); getStore(context).put(context.getUniqueId() + ANNOTATION_DEPLOYMENT_ID_KEY, deploymentIdFromDeploymentAnnotation); }); }
Example #28
Source File: FlowableServletContextListener.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override public void contextInitialized(ServletContextEvent event) { LOGGER.info("Booting Flowable Process Engine"); ProcessEngine processEngine = null; try { processEngine = ProcessEngines.getDefaultProcessEngine(); } catch (Exception e) { LOGGER.error("Error starting the Flowable REST API", e); } if (processEngine == null) { LOGGER.error("Could not start the Flowable REST API"); } }
Example #29
Source File: AbstractFlowableTestCase.java From flowable-engine with Apache License 2.0 | 5 votes |
protected static void cleanDeployments(ProcessEngine processEngine) { ProcessEngineConfiguration processEngineConfiguration = processEngine.getProcessEngineConfiguration(); for (String autoDeletedDeploymentId : deploymentIdsForAutoCleanup) { processEngineConfiguration.getRepositoryService().deleteDeployment(autoDeletedDeploymentId, true); } deploymentIdsForAutoCleanup.clear(); }
Example #30
Source File: AbstractFlowableTestCase.java From flowable-engine with Apache License 2.0 | 5 votes |
@BeforeEach public final void initializeServices(ProcessEngine processEngine) { processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration(); this.processEngine = processEngine; repositoryService = processEngine.getRepositoryService(); runtimeService = processEngine.getRuntimeService(); taskService = processEngine.getTaskService(); formService = processEngine.getFormService(); historyService = processEngine.getHistoryService(); identityService = processEngine.getIdentityService(); managementService = processEngine.getManagementService(); dynamicBpmnService = processEngine.getDynamicBpmnService(); processMigrationService = processEngine.getProcessMigrationService(); }