1、說明
camunda使用Java開的工作流引擎。這里使用springboot 2.2.6.release + camunda 3.4.2
2、配置實(shí)戰(zhàn)
使用camunda流程引擎、web界面、Rest服務(wù)接口相應(yīng)依賴如下:
- 流程引擎:camunda-bpm-spring-boot-starter
- Rest服務(wù)接口:camunda-bpm-spring-boot-starter-rest
- web界面模塊:camunda-bpm-spring-boot-starter-webapp
如果僅僅是使用流程引擎,只需要引入camunda-bpm-spring-boot-starter就可以了。
(1)pom.xml文件配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
< properties > < camunda.version >3.4.2</ camunda.version > </ properties > <!-- camunda --> < dependency > < groupId >org.camunda.bpm.springboot</ groupId > < artifactId >camunda-bpm-spring-boot-starter-webapp</ artifactId > < version >${camunda.version}</ version > </ dependency > < dependency > < groupId >org.camunda.bpm.springboot</ groupId > < artifactId >camunda-bpm-spring-boot-starter-rest</ artifactId > < version >${camunda.version}</ version > </ dependency > <!-- camunda --> < dependency > < groupId >org.camunda.bpm.springboot</ groupId > < artifactId >camunda-bpm-spring-boot-starter</ artifactId > < version >${camunda.version}</ version > </ dependency > |
(2)yml文件配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
camunda: bpm: # 配置賬戶密碼來訪問Camunda自帶的管理界面 admin-user: id: admin password: admin first-name: admin filter: create: All tasks #指定數(shù)據(jù)庫類型 # database: # type: mysql #禁止自動(dòng)部署resources下面的bpmn文件 auto-deployment-enabled: false #禁止index跳轉(zhuǎn)到Camunda自帶的管理界面,默認(rèn)true # webapp: # index-redirect-enabled: false |
(3)啟動(dòng)項(xiàng)目
瀏覽器輸入:http://localhost:8050/family-admin(項(xiàng)目的tomcat-context路徑)可以查看當(dāng)前工作流中的相關(guān)tasklist等
第一次啟動(dòng),Mysql數(shù)據(jù)庫會(huì)自動(dòng)生成Camunda相關(guān)數(shù)據(jù)庫表
3、生成數(shù)據(jù)庫表說明
- ACT_RE_*:RE代表存repository。帶有此前綴的表包含“靜態(tài)”信息,例如流程定義和流程資源(圖像、規(guī)則等)。
- ACT_RU_*:RU代表runtime。這些是運(yùn)行時(shí)表,包含流程實(shí)例、用戶任務(wù)、變量、作業(yè)等的運(yùn)行時(shí)數(shù)據(jù)。引擎僅在流程實(shí)例執(zhí)行期間存儲(chǔ)運(yùn)行時(shí)數(shù)據(jù),并在流程實(shí)例結(jié)束時(shí)刪除記錄。這使運(yùn)行時(shí)表既小又快。
- ACT_ID_*:ID代表identity。這些表包含身份信息,例如用戶、組等。
- ACT_HI_*:HI代表history。這些是包含歷史數(shù)據(jù)的表,例如過去的流程實(shí)例、變量、任務(wù)等。
- ACT_GE_*:GE代表 general一般數(shù)據(jù),用于各種用例
到此這篇關(guān)于springboot集成camunda的實(shí)現(xiàn)示例的文章就介紹到這了,更多相關(guān)springboot集成camunda內(nèi)容請(qǐng)搜索服務(wù)器之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持服務(wù)器之家!
原文鏈接:https://www.jianshu.com/p/67271eddc95b