首页 > 编程语言 > 详细

记camunda入门使用-1(基于spring boot)

时间:2020-06-04 21:27:56      阅读:114      评论:0      收藏:0      [点我收藏+]

准备工作

话不多说,之前使用过Activiti搭建工作流,但在这边没有记录完全,正好最近有一个camunda的项目,就决定同时记录一下项目的开发过程,以便之后再用到。

spring boot版本为2.2.6.RELEASE,camunda基于camunda-bpm-spring-boot-starter,版本为3.4.2,这边分了多个module,自己使用可以自行合并

pom文件

父pom部分

   <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.grey</groupId>
    <artifactId>flowdemo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>flowdemo</name>
    <description>Demo For Camunnda</description>

    <properties>
        <java.version>1.8</java.version>
        <spring-cloud-alibaba.version>2.2.0.RELEASE</spring-cloud-alibaba.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- swagger2 -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.0</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.9.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.1.22</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.10</version>
        </dependency>

    </dependencies>

子pom部分

     <dependencies>
        <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
            <version>3.4.2</version>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
            <version>3.4.2</version>
        </dependency>
    </dependencies>

 

配置文件

以下为yaml文件配置

server:
  port: 8081

#camunda 配置
camunda:
  bpm:
    #登录用户账号密码
    admin-user:
      id: admin
      password: admin
      firstName: admin
    filter:
      create: All tasks
    job-execution:
      enabled: true
    metrics:
      enabled: false
      db-reporter-activate: false

#mysql 数据库配置 camunda会在启动时自动在此数据库中新建表结构
spring:
  application:
    name: camunda-demo
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/camunda?serverTimezone=UTC
    username: root
    password: root
    type: com.alibaba.druid.pool.DruidDataSource

 

目录配置

 

记camunda入门使用-1(基于spring boot)

原文:https://www.cnblogs.com/sefuture/p/13045687.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!