Package com.flowable.spring.boot
Class AbstractSpringEngineAutoConfiguration
java.lang.Object
com.flowable.spring.boot.AbstractEngineAutoConfiguration
com.flowable.spring.boot.AbstractSpringEngineAutoConfiguration
- Direct Known Subclasses:
AppEngineAutoConfiguration,CmmnEngineAutoConfiguration,DmnEngineAutoConfiguration,EventRegistryAutoConfiguration,FormEngineAutoConfiguration,IdmEngineAutoConfiguration,ProcessEngineAutoConfiguration
public abstract class AbstractSpringEngineAutoConfiguration extends AbstractEngineAutoConfiguration
Base auto configuration for the different engines.
- Author:
- Filip Hrisafov, Javier Casal
-
Field Summary
Fields inherited from class com.flowable.spring.boot.AbstractEngineAutoConfiguration
flowableProperties, logger, resourcePatternResolver -
Constructor Summary
Constructors Constructor Description AbstractSpringEngineAutoConfiguration(FlowableProperties flowableProperties) -
Method Summary
Modifier and Type Method Description protected 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 com.flowable.spring.boot.AbstractEngineAutoConfiguration
configureEngine, defaultIfNotNull, defaultText, discoverDeploymentResources, getCustomMybatisMapperClasses, setResourcePatternResolver
-
Constructor Details
-
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, @CmmnObjectProvider<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
-