最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時(shí)間:2021年06月24日 14:26:08   作者:大齡碼農(nóng)有夢(mèng)想  
本文介紹基于mysql數(shù)據(jù)庫,如何實(shí)現(xiàn)camunda與springboot的集成,如何實(shí)現(xiàn)基于springboot運(yùn)行camunda開源流程引擎,本文分步驟圖文相結(jié)合給大家介紹的非常詳細(xì),需要的朋友參考下吧

一、創(chuàng)建springboot工程

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

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

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

二、修改maven配置

2.1、修改springboot版本號(hào)

由于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這三個(gè)依賴包,如果僅僅是使用流程引擎,只需要引入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配置

打開工程目錄下的main\resources\application.yaml文件,如果沒有該文件,手動(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ù)庫,數(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平臺(tái)創(chuàng)建一個(gè)數(shù)據(jù)庫模式,名稱為camunda715

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

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

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

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

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

package com.example.demo1;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class CamundaDemo1Application {

public static void main(String[] args) {
SpringApplication.run(CamundaDemo1Application.class, args);
}

}

六、登錄訪問camunda

訪問:http://localhost:8080,

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

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

至此,完成了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)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • 詳解JAVA8 函數(shù)式接口

    詳解JAVA8 函數(shù)式接口

    這篇文章主要介紹了JAVA8 函數(shù)式接口的相關(guān)資料,文中講解非常細(xì)致,代碼幫助大家更好的理解和學(xué)習(xí),感興趣的朋友可以了解下
    2020-07-07
  • 使用Mybatis遇到的there is no getter異常

    使用Mybatis遇到的there is no getter異常

    這篇文章主要介紹了使用Mybatis遇到的there is no getter異常,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-09-09
  • Netty序列化深入理解與使用

    Netty序列化深入理解與使用

    序列化 (Serialization)是將對(duì)象的狀態(tài)信息轉(zhuǎn)換為可以存儲(chǔ)或傳輸?shù)男问降倪^程。在序列化期間,對(duì)象將其當(dāng)前狀態(tài)寫入到臨時(shí)或持久性存儲(chǔ)區(qū)。以后,可以通過從存儲(chǔ)區(qū)中讀取或反序列化對(duì)象的狀態(tài),重新創(chuàng)建該對(duì)象
    2022-08-08
  • Java8新特性O(shè)ptional常用方法

    Java8新特性O(shè)ptional常用方法

    optional類是Java8新增加的一個(gè)對(duì)象容器,主要的功能有對(duì)象的創(chuàng)建、獲取、判斷、過濾,映射等,下面這篇文章主要給大家介紹了關(guān)于Java8新特性O(shè)ptional常用方法的相關(guān)資料,需要的朋友可以參考下
    2024-02-02
  • Spring成員對(duì)象注入的三種方式詳解

    Spring成員對(duì)象注入的三種方式詳解

    這篇文章主要為大家詳細(xì)介紹了Spring成員對(duì)象注入的三種方式,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下,希望能夠給你帶來幫助
    2022-02-02
  • Spring?Security?過濾器注冊(cè)脈絡(luò)梳理

    Spring?Security?過濾器注冊(cè)脈絡(luò)梳理

    這篇文章主要介紹了Spring?Security過濾器注冊(cè)脈絡(luò)梳理,Spring?Security在Servlet的過濾鏈中注冊(cè)了一個(gè)過濾器FilterChainProxy,它會(huì)把請(qǐng)求代理到Spring?Security自己維護(hù)的多個(gè)過濾鏈,每個(gè)過濾鏈會(huì)匹配一些URL,如果匹配則執(zhí)行對(duì)應(yīng)的過濾器
    2022-08-08
  • Spring 數(shù)據(jù)庫連接池(JDBC)詳解

    Spring 數(shù)據(jù)庫連接池(JDBC)詳解

    本篇文章主要介紹了基于Spring的JDBC基本框架搭建;基于Spring的JDBC增刪改查;讀取配置文件中的數(shù)據(jù)等,具有很好的參考價(jià)值。下面跟著小編一起來看下吧
    2017-05-05
  • Java Swing JPasswordField密碼框的實(shí)現(xiàn)示例

    Java Swing JPasswordField密碼框的實(shí)現(xiàn)示例

    這篇文章主要介紹了Java Swing JPasswordField密碼框的實(shí)現(xiàn)示例,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-12-12
  • Spring mvc服務(wù)端數(shù)據(jù)校驗(yàn)實(shí)現(xiàn)流程詳解

    Spring mvc服務(wù)端數(shù)據(jù)校驗(yàn)實(shí)現(xiàn)流程詳解

    這篇文章主要介紹了Spring mvc服務(wù)端數(shù)據(jù)校驗(yàn)實(shí)現(xiàn)流程詳解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-09-09
  • java實(shí)現(xiàn)兩張圖片2D翻轉(zhuǎn)動(dòng)畫效果

    java實(shí)現(xiàn)兩張圖片2D翻轉(zhuǎn)動(dòng)畫效果

    這篇文章主要為大家詳細(xì)介紹了java實(shí)現(xiàn)兩張圖片2D翻轉(zhuǎn)動(dòng)畫效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-08-08

最新評(píng)論

寿光市| 浦县| 屏东县| 延吉市| 修水县| 崇左市| 茂名市| 武冈市| 胶州市| 宜宾县| 灵丘县| 海兴县| 西吉县| 夹江县| 铜陵市| 建平县| 新竹市| 甘德县| 沐川县| 九江市| 霍州市| 固始县| 富川| 江油市| 海盐县| 昌宁县| 泗洪县| 蒙山县| 共和县| 枝江市| 长武县| 高密市| 武隆县| 古浪县| 朝阳市| 彭泽县| 九江市| 大悟县| 商丘市| 南陵县| 五指山市|