Flowable 6.6.0 用户指南相关文档下载
- BPMN用户指南 第一部分 - 中文PDF精编版
- BPMN用户指南 第二部分 - 中文PDF精编版
- BPMN用户指南 第三部分 - 中文PDF精编版
- 应用程序指南 - 中文PDF精编版
- 应用程序指南 - 中英对照PDF精编版
- 应用程序指南 - Eclipse设计器中文PDF精编版
- 表单用户指南 - 中文PDF精编版
- 事件注册表用户指南 - 中文PDF精编版
Flowable 6.6.0 应用程序培训视频
Flowable 6.6.0应用指南
- Flowable 应用程序概述
- Flowable UI应用安装
- Flowable UI应用配置(1)
- Flowable UI应用配置(2)
- Flowable身份管理应用程序
- Flowable 建模器应用程序(1)
- Flowable 建模器应用程序(2)
- Flowable 任务应用程序
- Flowable 管理应用程序(1)
- Flowable 管理应用程序(2)
- 国际化
- 生产就绪端点
- 自定义bean部署
有多种方法可以向Flowable应用程序提供自定义bean。
自定义bean部署
1.使用Spring Boot 自动配置
Flowable应用程序是一个Spring Boot 2应用程序。这意味着可以使用正常的Spring Boot 自动配置来使bean可部署到Flowable。这可以通过以下方式完成
package com.your.own.package.configuration;
@Configuration
@AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE) // Makes sure that this configuration will be processed last by Spring Boot
@ConditionalOnBean(type = "org.flowable.engine.ProcessEngine") // The configuration will only be used when the ProcessEngine bean is present
public class YourOwnConfiguration {
@Configuration
@ComponentScan ("com.your.own.package.beans")
public static class ComponentScanConfiguration {
// This class is needed in order to conditionally perform the component scan (i.e. when the ProcessEngine bean is present)
// It is an optional class, in case you don't need component scanning then you don't need to do this
}
@Bean
public CustomBean customBean() {
// create your bean
}
@Bean
public EngineConfigurationConfigurer<SpringProcessEngineConfiguration> customProcessEngineConfigurationConfigurer() {
return engineConfiguration -> {
// You can use this to add extra configuration to the process engine
}
}
}
请注意,当使用Spring Boot时,配置类可以在您自己的包下,而不是在某个Flowable的包下。
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.your.own.package.configuration.YourOwnCustomConfiguration
为了使这个类成为一个自动配置类,应该在jar的META-INF文件夹中创建一个名为 spring.factories。在这个文件中,你应该添加
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.your.own.package.configuration.YourOwnCustomConfiguration
为了使用这种方法,您需要将您的jar包含在解压后的war的WEB-INF/lib文件夹中。由于Spring代理@Configuration类的方式,将这个jar放在servlet容器(例如Tomcat)的lib文件夹中是行不通的。
2.组件扫描
另一种向Flowable引擎提供定制Spring bean的方法是:将它们放在某个包下,然后让Flowable应用程序组件扫描该包。根据所使用的应用程序,此软件包有所不同:
- flowable-rest.war使用org.flowable.rest.app
- flowable-ui.war使用org.flowable.ui.application
自定义bean可以位于单个JAR中,当应用程序启动时,这个JAR应该出现在classpath上。根据JAR的放置位置、servlet容器的lib文件夹(例如Tomcat),或被解压缩的war的WEB-INF/lib文件夹,存在不同的可能性。
当使用servlet容器的lib文件夹时,创建的类应该是自包含的,也就是说,它们应该只使用jar中的类。您可以使用任何Spring @Component注释(除了 @Configuration)。不能使用 @Configuration类的原因是每个配置类都由Spring在ConfigurationClassPostProcessor的帮助下代理(proxied)。但是,加载 @Configuration类的类加载器无法通过Spring访问所需的类。
当将jar包含在被解压缩的war的WEB-INF/lib文件夹中时, @Configuration类和对其他jar的依赖是可用的。
3.创建自己的Spring Boot 应用程序
这种方法是所有方法中最灵活和最强大的方法。为了遵循这种方法,请看一下文档中的Spring Boot入门部分(Getting Started with Spring Boot)。