Package org.flowable.spring.boot
Class AbstractSpringEngineAutoConfiguration
java.lang.Object
org.flowable.spring.boot.AbstractEngineAutoConfiguration
org.flowable.spring.boot.AbstractSpringEngineAutoConfiguration
- Direct Known Subclasses:
AppEngineAutoConfiguration,CmmnEngineAutoConfiguration,DmnEngineAutoConfiguration,EventRegistryAutoConfiguration,ProcessEngineAutoConfiguration
Base auto configuration for the different engines.
- Author:
- Filip Hrisafov, Javier Casal
-
Field Summary
Fields inherited from class org.flowable.spring.boot.AbstractEngineAutoConfiguration
flowableProperties, logger, resourcePatternResolver -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSpringEngineAutoConfiguration(FlowableProperties flowableProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureSpringEngine(org.flowable.common.spring.SpringEngineConfiguration engineConfiguration, org.springframework.transaction.PlatformTransactionManager transactionManager) protected <T> TgetIfAvailable(org.springframework.beans.factory.ObjectProvider<T> availableProvider, org.springframework.beans.factory.ObjectProvider<T> uniqueProvider) Get the Object provided by theavailableProvider, otherwise get a unique object fromuniqueProvider.Methods inherited from class org.flowable.spring.boot.AbstractEngineAutoConfiguration
configureEngine, defaultText, discoverDeploymentResources, getCustomMybatisMapperClasses, setResourcePatternResolver
-
Constructor Details
-
AbstractSpringEngineAutoConfiguration
-
-
Method Details
-
configureSpringEngine
protected void configureSpringEngine(org.flowable.common.spring.SpringEngineConfiguration engineConfiguration, org.springframework.transaction.PlatformTransactionManager transactionManager) -
getIfAvailable
protected <T> T getIfAvailable(org.springframework.beans.factory.ObjectProvider<T> availableProvider, org.springframework.beans.factory.ObjectProvider<T> uniqueProvider) Get the Object provided by theavailableProvider, otherwise get a unique object fromuniqueProvider. This can be used when we allow users to provide specific implementations per engine. For example to provide a specificTaskExecutorand / orSpringRejectedJobsHandlerfor the CMMN Async Executor. Example:
Then when using:@Configuration public class MyCustomConfiguration { @Bean @Cmmn public TaskExecutor cmmnTaskExecutor() { return new MyCustomTaskExecutor() } @@Bean @Primary public TaskExecutor primaryTaskExecutor() { return new SimpleAsyncTaskExecutor() } }@Configuration public class FlowableJobConfiguration { public SpringAsyncExecutor cmmnAsyncExecutor( ObjectProvider<TaskExecutor> taskExecutor, @Cmmn ObjectProvider<TaskExecutor> cmmnTaskExecutor ) { TaskExecutor executor = getIfAvailable( cmmnTaskExecutor, taskExecutor ); // executor is an instance of MyCustomTaskExecutor } public SpringAsyncExecutor processAsyncExecutor( ObjectProvider<TaskExecutor> taskExecutor, @Process ObjectProvider<TaskExecutor> processTaskExecutor ) { TaskExecutor executor = getIfAvailable( processTaskExecutor, taskExecutor ); // executor is an instance of SimpleAsyncTaskExecutor } }- Type Parameters:
T- the type of the object being provided- Parameters:
availableProvider- a provider that can provide an available objectuniqueProvider- a provider that would be used if there is no available object, but only if it is unique- Returns:
- the available object from
availableProviderif there, otherwise the unique object fromuniqueProvider
-