public abstract class AbstractSpringEngineAutoConfiguration extends AbstractEngineAutoConfiguration
flowableProperties, logger, resourcePatternResolver| Constructor and Description |
|---|
AbstractSpringEngineAutoConfiguration(FlowableProperties flowableProperties) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureSpringEngine(org.flowable.common.spring.SpringEngineConfiguration engineConfiguration,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
protected <T> T |
getIfAvailable(org.springframework.beans.factory.ObjectProvider<T> availableProvider,
org.springframework.beans.factory.ObjectProvider<T> uniqueProvider)
Get the Object provided by the
availableProvider, otherwise get a unique object from uniqueProvider. |
configureEngine, defaultIfNotNull, defaultText, discoverDeploymentResources, getCustomMybatisMapperClasses, setResourcePatternResolverpublic AbstractSpringEngineAutoConfiguration(FlowableProperties flowableProperties)
protected void configureSpringEngine(org.flowable.common.spring.SpringEngineConfiguration engineConfiguration,
org.springframework.transaction.PlatformTransactionManager transactionManager)
protected <T> T getIfAvailable(org.springframework.beans.factory.ObjectProvider<T> availableProvider,
org.springframework.beans.factory.ObjectProvider<T> uniqueProvider)
availableProvider, otherwise get a unique object from uniqueProvider.
This can be used when we allow users to provide specific implementations per engine. For example to provide a specific
TaskExecutor and / or SpringRejectedJobsHandler for the CMMN Async
Executor. Example:
@Configuration
public class MyCustomConfiguration {
@Bean
@Cmmn
public TaskExecutor cmmnTaskExecutor() {
return new MyCustomTaskExecutor()
}
@@Bean
@Primary
public TaskExecutor primaryTaskExecutor() {
return new SimpleAsyncTaskExecutor()
}
}
Then when using:
@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
}
}
T - the type of the object being providedavailableProvider - 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 uniqueavailableProvider if there, otherwise the unique object from uniqueProviderCopyright © 2022 Flowable. All rights reserved.