使用springboot activiti關(guān)閉驗證自動部署方式
springboot activiti關(guān)閉驗證自動部署
# spring-activiti # 自動部署驗證設(shè)置:true-開啟(默認(rèn))、false-關(guān)閉 spring.activiti.check-process-definitions=false # asyncExecutorEnabled屬性設(shè)置設(shè)置true后將代替那些老的Job executor spring.activiti.async-executor-enabled=false spring.activiti.job-executor-activate=false # asyncExecutorActivate是指activiti在流程引擎啟動就激活A(yù)syncExecutor,異步:true-開啟(默認(rèn))、false-關(guān)閉 spring.activiti.async-executor-activate=true # 使用自定義的mybatis-mapper spring.activiti.custom-mybatis-mappers= spring.activiti.custom-mybatis-xmlmappers=
SpringBoot2.0 activiti6.0自動部署流程圖
給大家分享我所總結(jié)的自動部署流程的兩種方法:
1、修改yaml文件關(guān)于activiti的配置
2、在SpringBoot項目啟動的時候自動執(zhí)行部署方法
1)要將yaml文件中的check-process-definitions(自動檢查,部署流程定義文件)修改為false
2)新建實現(xiàn)類實現(xiàn)ApplicationRunner中run方法,并在類上方添加@Component注解
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一定要與流程圖名稱保持一致,不然掃描流程圖會報錯。。
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
解決java啟動時報線程占用報錯:Exception?in?thread?“Thread-14“?java.ne
這篇文章主要給大家介紹了關(guān)于解決java啟動時報線程占用:Exception?in?thread?“Thread-14“?java.net.BindException:?Address?already?in?use:?bind的相關(guān)資料,文中將解決的辦法介紹的非常詳細(xì),需要的朋友可以參考下2023-04-04EasyExcel自定義導(dǎo)出列和順序?qū)嵗a
這篇文章主要給大家介紹了關(guān)于EasyExcel自定義導(dǎo)出列和順序的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-07-07SpringBoot?動態(tài)加載?Jar?包實現(xiàn)靈活的動態(tài)配置完美方案
SpringBoot作為一個開發(fā)快速、部署方便的微服務(wù)框架,具有自動配置、約定優(yōu)于配置的特點,能夠極大地提高開發(fā)效率,它提供了豐富的擴(kuò)展點,非常適合實現(xiàn)動態(tài)加載Jar包的功能,本文將深入探討如何在SpringBoot應(yīng)用中實現(xiàn)動態(tài)加載Jar包的方案,感興趣的朋友一起看看吧2024-04-04JavaWeb連接數(shù)據(jù)庫MySQL的操作技巧
數(shù)據(jù)庫是編程中重要的一部分,它囊括了數(shù)據(jù)操作,數(shù)據(jù)持久化等各方面。在每一門編程語言中都占有相當(dāng)大的比例。本次,小編以MySQL為例,使用mvc編程思想,給大家講解下javaweb對數(shù)據(jù)庫的操作2017-02-02