springboot activiti關閉驗證自動部署
1
2
3
4
5
6
7
8
9
10
11
|
# spring-activiti # 自動部署驗證設置: true -開啟(默認)、 false -關閉 spring.activiti.check-process-definitions= false # asyncExecutorEnabled屬性設置設置 true 后將代替那些老的Job executor spring.activiti.async-executor-enabled= false spring.activiti.job-executor-activate= false # asyncExecutorActivate是指activiti在流程引擎啟動就激活AsyncExecutor,異步: true -開啟(默認)、 false -關閉 spring.activiti.async-executor-activate= true # 使用自定義的mybatis-mapper spring.activiti.custom-mybatis-mappers= spring.activiti.custom-mybatis-xmlmappers= |
SpringBoot2.0 activiti6.0自動部署流程圖
給大家分享我所總結的自動部署流程的兩種方法:
1、修改yaml文件關于activiti的配置
2、在SpringBoot項目啟動的時候自動執行部署方法
1)要將yaml文件中的check-process-definitions(自動檢查,部署流程定義文件)修改為false
2)新建實現類實現ApplicationRunner中run方法,并在類上方添加@Component注解
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package com.komlin.controller; import org.activiti.engine.RepositoryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.stereotype.Component; import java.io.IOException; /** * Description:部署流程圖 * date: 2020/7/8 17:07 * * @author mt * @since JDK 1.8 */ @Component public class ApplicationRunnerImpl implements ApplicationRunner { @Autowired RepositoryService repositoryService; @Override public void run(ApplicationArguments args) throws Exception { Resource[] resources = null ; try { resources = new PathMatchingResourcePatternResolver().getResources( "classpath:processes/*.bpmn" ); } catch (IOException e) { e.printStackTrace(); } for (Resource r : resources) { String addr = "processes/" + r.getFilename(); repositoryService.createDeployment().addClasspathResource(addr).deploy(); } } } |
注:新建的流程圖中的id一定要與流程圖名稱保持一致,不然掃描流程圖會報錯。。
以上為個人經驗,希望能給大家一個參考,也希望大家多多支持服務器之家。
原文鏈接:https://blog.csdn.net/dengyl2008/article/details/79031974