午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

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

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

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

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

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

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

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

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

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

二、修改maven配置2.1、修改springboot版本號

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

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

具體配置參考camunda官方說明文檔: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這三個依賴包,如果僅僅是使用流程引擎,只需要引入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配置

打開工程目錄下的mainresourcesapplication.yaml文件,如果沒有該文件,手動新建一個,錄入如下信息。

# 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ù)庫,數(shù)據(jù)庫URL、username、 password 跟后面數(shù)據(jù)庫信息保存一致。

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

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

為Camunda平臺創(chuàng)建一個數(shù)據(jù)庫模式,名稱為camunda715

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

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

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

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

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

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

五、啟動springboot工程

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

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的集成流程分析

六、登錄訪問camunda

訪問:http://localhost:8080,

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

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

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

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

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

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的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標(biāo)簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 中文字幕永久在线视频 | 亚洲精品乱码 | 奇米超碰在线 | 国产精品欧美综合 | 天堂а√在线中文在线鲁大师 | 国产免费播放 | 中文字幕二 | 日韩精品天堂 | 成人免费毛片aaaaaa片 | 免费成人在线视频观看 | 一级做a爱片性色毛片 | 色综合天天操 | 日本一区二区三区精品视频 | 亚洲精品国产精品国自产 | 日韩欧美在线视频免费观看 | 天天拍夜夜操 | 一级片在线 | 中文字幕av一区 | 麻豆网站在线观看 | 国产日韩第一页 | 国产刺激高潮av | 黄色录像特级片 | 69精品久久久久久 | 亚洲精品日韩在线观看 | 欧美肥老妇视频 | 在线精品国产 | 亚洲综合黄色 | 99成人免费视频 | 国产欧美激情 | 黄色小视频免费在线观看 | 日韩一区二区在线观看视频 | 欧美a级片视频 | 国产精品美女久久久 | 在线观看黄色小视频 | 亚洲欧洲在线观看 | www.久久久久.com | 北条麻妃99精品青青久久 | 欧美日皮视频 | 亚洲黄色一级 | 成人激情四射 | www婷婷|