springboot整合Flowable
时间: 2023-09-17 14:11:29 浏览: 148
Spring Boot整合Flowable可以通过引入相关依赖和配置文件来实现。
首先,在配置文件中需要设置以下几个属性:
- `flowable.standalone.server.enabled=false`:禁用Flowable的独立服务器模式。
- `spring.main.allow-bean-definition-overriding=true`:允许Bean的覆盖。
- `flowable.async-executor-activate=false`:关闭定时任务的执行。
- `flowable.idm.enabled=false`:禁用身份信息的检测。
- `flowable.database-schema-update=false`:禁止生成数据库表。
其次,需要在pom.xml文件中引入Flowable和Xerces的相关依赖:
```
<!-- https://mvnrepository.com/artifact/org.flowable/flowable-spring-boot-starter -->
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter</artifactId>
<version>6.7.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/xerces/xercesImpl -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.2</version>
</dependency>
```
最后,可以创建一个测试类,并注入所需的Flowable服务:
```
@RunWith(SpringRunner.class)
@SpringBootTest(classes = BizApp.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class FlowableTest {
@Autowired
private RepositoryService repositoryService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@Autowired
private HistoryService historyService;
}
```
通过以上步骤,就可以在Spring Boot项目中成功整合Flowable流程引擎。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [springboot整合flowable](https://blog.csdn.net/RenshenLi/article/details/124547710)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文