1候址、說(shuō)明
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文件配置
<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文件配置
camunda:
bpm:
# 配置賬戶密碼來(lái)訪問(wèn)Camunda自帶的管理界面
admin-user:
id: admin
password: admin
first-name: admin
filter:
create: All tasks
#指定數(shù)據(jù)庫(kù)類型
# 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ù)庫(kù)會(huì)自動(dòng)生成Camunda相關(guān)數(shù)據(jù)庫(kù)表
3耕驰、生成數(shù)據(jù)庫(kù)表說(shuō)明
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ù)的表,例如過(guò)去的流程實(shí)例球订、變量后裸、任務(wù)等。
ACT_GE_*
:GE代表 general一般數(shù)據(jù)冒滩,用于各種用例