电脑知识|欧美黑人一区二区三区|软件|欧美黑人一级爽快片淫片高清|系统|欧美黑人狂野猛交老妇|数据库|服务器|编程开发|网络运营|知识问答|技术教程文章 - 好吧啦网

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

Springboot整合camunda+mysql的集成流程分析

瀏覽:5日期:2023-02-05 15:36:30
目錄一、創(chuàng)建springboot工程二、修改maven配置2.1、修改springboot版本號(hào)2.2、引入camunda包三、修改application.yaml配置四、創(chuàng)建mysql數(shù)據(jù)庫(kù)五、啟動(dòng)springboot工程六、登錄訪(fǎng)問(wèn)camunda一、創(chuàng)建springboot工程

使用IDEA工具,選擇File->New->Project,選擇Spring Initialzr

Springboot整合camunda+mysql的集成流程分析

輸入springboot工程基本信息,本示例命名為“camunda-demo1”, jdk版本選擇8

Springboot整合camunda+mysql的集成流程分析

在選擇springboot組件的時(shí)候,需要選擇Spring Web、JDBC API、MySql Driver 這三個(gè)組件。點(diǎn)擊下一步完成即可。

Springboot整合camunda+mysql的集成流程分析

二、修改maven配置2.1、修改springboot版本號(hào)

由于camunda版本與springboot版本有匹配關(guān)系,所以需要修改springboot版本為2.4.3,

官方推薦Camunda7.1.5版本使用Spring Boot 2.4.x版本

具體配置參考camunda官方說(shuō)明文檔:https://docs.camunda.org/manual/7.15/user-guide/spring-boot-integration/version-compatibility/

Pom.xm代碼片段:

<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.4.3</version><relativePath/> </parent>2.2、引入camunda包

由于本示例要使用camunda流程引擎、web界面、Rest服務(wù)接口,所以需要導(dǎo)入camunda-bpm-spring-boot-starter、camunda-bpm-spring-boot-starter-rest、camunda-bpm-spring-boot-starter-webapp這三個(gè)依賴(lài)包,如果僅僅是使用流程引擎,只需要引入camunda-bpm-spring-boot-starter就可以了。

完整的pom.xml文件如下:

<?xml version='1.0' encoding='UTF-8'?> <project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd'> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.3</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>camunda-demo1</artifactId> <version>0.0.1-SNAPSHOT</version> <name>camunda-demo1</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.camunda.bpm.springboot</groupId> <artifactId>camunda-bpm-spring-boot-starter</artifactId> <version>7.15.0</version> </dependency> <dependency> <groupId>org.camunda.bpm.springboot</groupId> <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId> <version>7.15.0</version> </dependency> <dependency> <groupId>org.camunda.bpm.springboot</groupId> <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId> <version>7.15.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>三、修改application.yaml配置

打開(kāi)工程目錄下的mainresourcesapplication.yaml文件,如果沒(méi)有該文件,手動(dòng)新建一個(gè),錄入如下信息。

# Find more available configuration properties on the following pages of the documentation. # https://docs.camunda.org/manual/latest/user-guide/camunda-bpm-run/#configure-camunda-bpm-run # https://docs.camunda.org/manual/latest/user-guide/spring-boot-integration/configuration/#camunda-engine-properties camunda.bpm: generic-properties.properties: javaSerializationFormatEnabled: true admin-user: id: demo password: demo run: # https://docs.camunda.org/manual/latest/user-guide/camunda-bpm-run/#cross-origin-resource-sharing cors: enabled: true allowed-origins: '*' # datasource configuration is required spring.datasource: url: jdbc:mysql://127.0.0.1:3306/camunda715?characterEncoding=UTF-8&useUnicode=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai driver-class-name: com.mysql.cj.jdbc.Driver username: root password: root # By default, Spring Boot serves static content from any directories called /static or /public or /resources or # /META-INF/resources in the classpath. To prevent users from accidentally sharing files, this is disabled here by setting static locations to NULL. # https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-spring-mvc-static-content spring.web.resources: static-locations: NULL

本示例使用的是mysql數(shù)據(jù)庫(kù),數(shù)據(jù)庫(kù)URL、username、 password 跟后面數(shù)據(jù)庫(kù)信息保存一致。

四、創(chuàng)建mysql數(shù)據(jù)庫(kù)

Camunda默認(rèn)使用已預(yù)先配置好的H2數(shù)據(jù)庫(kù),本示例使用mysql數(shù)據(jù)庫(kù),需要提前創(chuàng)建mysql數(shù)據(jù)庫(kù)并導(dǎo)入Camunda建表腳本。

為Camunda平臺(tái)創(chuàng)建一個(gè)數(shù)據(jù)庫(kù)模式,名稱(chēng)為camunda715

Springboot整合camunda+mysql的集成流程分析

導(dǎo)入SQL腳本。執(zhí)行創(chuàng)建所有必需的表和默認(rèn)索引的SQL DDL腳本。這些腳本可以在configuration/sql/create文件夾中找到。共2個(gè)腳本,都需要導(dǎo)入。

Springboot整合camunda+mysql的集成流程分析

導(dǎo)入完成后的表結(jié)構(gòu),共40張表:

Springboot整合camunda+mysql的集成流程分析

詳細(xì)配置方法參考:https://lowcode.blog.csdn.net/article/details/117564836

五、啟動(dòng)springboot工程

創(chuàng)建springboot工程的時(shí)候,自動(dòng)生成了SpringBootApplication啟動(dòng)類(lèi),運(yùn)行改類(lèi)啟動(dòng)即可。

package com.example.demo1;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpublic class CamundaDemo1Application {public static void main(String[] args) {SpringApplication.run(CamundaDemo1Application.class, args);}}

Springboot整合camunda+mysql的集成流程分析

六、登錄訪(fǎng)問(wèn)camunda

訪(fǎng)問(wèn):http://localhost:8080,

默認(rèn)賬號(hào)密碼demo/demo

Springboot整合camunda+mysql的集成流程分析

登錄成功后進(jìn)入camunda控制臺(tái)

Springboot整合camunda+mysql的集成流程分析

至此,完成了springboot2.4.3+camunda7.15+mysql的集成,后續(xù)的如何設(shè)計(jì)流程、如何啟動(dòng)流程、如何審批流程等操作,跟非springboot方式是一致的,請(qǐng)參考前面的文章。

https://lowcode.blog.csdn.net/article/details/117518828

https://lowcode.blog.csdn.net/article/details/118055189

以上就是Springboot整合camunda+mysql的集成實(shí)現(xiàn)方法的詳細(xì)內(nèi)容,更多關(guān)于Springboot整合camunda的資料請(qǐng)關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標(biāo)簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 化妆品加工厂-化妆品加工-化妆品代加工-面膜加工-广东欧泉生化科技有限公司 | 工业胀紧套_万向节联轴器_链条-规格齐全-型号选购-非标订做-厂家批发价格-上海乙谛精密机械有限公司 | 滁州高低温冲击试验箱厂家_安徽高低温试验箱价格|安徽希尔伯特 | 超声波清洗机_超声波清洗机设备_超声波清洗机厂家_鼎泰恒胜 | 消泡剂_水处理消泡剂_切削液消泡剂_涂料消泡剂_有机硅消泡剂_广州中万新材料生产厂家 | 河南橡胶接头厂家,河南波纹补偿器厂家,河南可曲挠橡胶软连接,河南套筒补偿器厂家-河南正大阀门 | 广州企亚 - 数码直喷、白墨印花、源头厂家、透气无手感方案服务商! | 生物风-销售载体,基因,质粒,ATCC细胞,ATCC菌株等,欢迎购买-百风生物 | 萃取箱-萃取槽-PVC萃取箱厂家-混合澄清槽- 杭州南方化工设备 | 沉降天平_沉降粒度仪_液体比重仪-上海方瑞仪器有限公司 | 网站建设,北京网站建设,北京网站建设公司,网站系统开发,北京网站制作公司,响应式网站,做网站公司,海淀做网站,朝阳做网站,昌平做网站,建站公司 | 安徽免检低氮锅炉_合肥燃油锅炉_安徽蒸汽发生器_合肥燃气锅炉-合肥扬诺锅炉有限公司 | SDI车窗夹力测试仪-KEMKRAFT方向盘测试仪-上海爱泽工业设备有限公司 | 粉末冶金注射成型厂家|MIM厂家|粉末冶金齿轮|MIM零件-深圳市新泰兴精密科技 | 防锈油-助焊剂-光学玻璃清洗剂-贝塔防锈油生产厂家 | SPC工作站-连杆综合检具-表盘气动量仪-内孔缺陷检测仪-杭州朗多检测仪器有限公司 | 拼装地板,悬浮地板厂家,悬浮式拼装运动地板-石家庄博超地板科技有限公司 | 贴板式电磁阀-不锈钢-气动上展式放料阀-上海弗雷西阀门有限公司 工业机械三维动画制作 环保设备原理三维演示动画 自动化装配产线三维动画制作公司-南京燃动数字 | 宿舍管理系统_智慧园区系统_房屋/房产管理系统_公寓管理系统 | 信阳网站建设专家-信阳时代网联-【信阳网站建设百度推广优质服务提供商】信阳网站建设|信阳网络公司|信阳网络营销推广 | 上海办公室装修公司_办公室设计_直营办公装修-羚志悦装 | 东莞市超赞电子科技有限公司 全系列直插/贴片铝电解电容,电解电容,电容器 | 立式矫直机_卧式矫直机-无锡金矫机械制造有限公司 | Safety light curtain|Belt Sway Switches|Pull Rope Switch|ultrasonic flaw detector-Shandong Zhuoxin Machinery Co., Ltd | 二手注塑机回收_旧注塑机回收_二手注塑机买卖 - 大鑫二手注塑机 二手光谱仪维修-德国OBLF光谱仪|进口斯派克光谱仪-热电ARL光谱仪-意大利GNR光谱仪-永晖检测 | 防潮防水通风密闭门源头实力厂家 - 北京酷思帝克门窗 | 电销卡 防封电销卡 不封号电销卡 电话销售卡 白名单电销卡 电销系统 外呼系统 | 短信通106短信接口验证码接口群发平台_国际短信接口验证码接口群发平台-速度网络有限公司 | 全自动不干胶贴标机_套标机-上海今昂贴标机生产厂家 | 接地电阻测试仪[厂家直销]_电缆故障测试仪[精准定位]_耐压测试仪-武汉南电至诚电力设备 | 北京开业庆典策划-年会活动策划公司-舞龙舞狮团大鼓表演-北京盛乾龙狮鼓乐礼仪庆典策划公司 | 岛津二手液相色谱仪,岛津10A液相,安捷伦二手液相,安捷伦1100液相-杭州森尼欧科学仪器有限公司 | 三氯异氰尿酸-二氯-三氯-二氯异氰尿酸钠-优氯净-强氯精-消毒片-济南中北_优氯净厂家 | 胶水,胶粘剂,AB胶,环氧胶,UV胶水,高温胶,快干胶,密封胶,结构胶,电子胶,厌氧胶,高温胶水,电子胶水-东莞聚力-聚厉胶粘 | 温室大棚建设|水肥一体化|物联网系统| 智能汉显全自动量热仪_微机全自动胶质层指数测定仪-鹤壁市科达仪器仪表有限公司 | 爱佩恒温恒湿测试箱|高低温实验箱|高低温冲击试验箱|冷热冲击试验箱-您身边的模拟环境试验设备技术专家-合作热线:400-6727-800-广东爱佩试验设备有限公司 | 传动滚筒_厂家-淄博海恒机械制造厂 | 滚塑PE壳体-PE塑料浮球-警示PE浮筒-宁波君益塑业有限公司 | 炒货机-炒菜机-炒酱机-炒米机@霍氏机械 | 楼梯定制_楼梯设计施工厂家_楼梯扶手安装制作-北京凌步楼梯 |