1、說明
camunda使用Java開的工作流引擎。這里使用springboot 2.2.6.release + camunda 3.4.2
2、配置實戰(zhàn)
使用camunda流程引擎、web界面、Rest服務接口相應依賴如下:
- 流程引擎:camunda-bpm-spring-boot-starter
- Rest服務接口: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 #禁止自動部署resources下面的bpmn文件 auto-deployment-enabled: false #禁止index跳轉(zhuǎn)到Camunda自帶的管理界面,默認true # webapp: # index-redirect-enabled: false |
(3)啟動項目
瀏覽器輸入:http://localhost:8050/family-admin(項目的tomcat-context路徑)可以查看當前工作流中的相關tasklist等
第一次啟動,Mysql數(shù)據(jù)庫會自動生成Camunda相關數(shù)據(jù)庫表
3、生成數(shù)據(jù)庫表說明
- ACT_RE_*:RE代表存repository。帶有此前綴的表包含“靜態(tài)”信息,例如流程定義和流程資源(圖像、規(guī)則等)。
- ACT_RU_*:RU代表runtime。這些是運行時表,包含流程實例、用戶任務、變量、作業(yè)等的運行時數(shù)據(jù)。引擎僅在流程實例執(zhí)行期間存儲運行時數(shù)據(jù),并在流程實例結束時刪除記錄。這使運行時表既小又快。
- ACT_ID_*:ID代表identity。這些表包含身份信息,例如用戶、組等。
- ACT_HI_*:HI代表history。這些是包含歷史數(shù)據(jù)的表,例如過去的流程實例、變量、任務等。
- ACT_GE_*:GE代表 general一般數(shù)據(jù),用于各種用例
到此這篇關于springboot集成camunda的實現(xiàn)示例的文章就介紹到這了,更多相關springboot集成camunda內(nèi)容請搜索服務器之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持服務器之家!
原文鏈接:https://www.jianshu.com/p/67271eddc95b