【Camunda工作流(1)工作笔记:SpringBoot整合Camunda】

Camunda BPM 与 Spring Boot 集成示例
本示例是根据 camunda.org官网Spring Boot集成入门指引创建的。

github地址:https://github.com/skayliu/CamundaSpringBootDemo

##本示例组件

1、Spring-Boot: (v2.2.1.RELEASE)

2、Camunda BPM: (v7.12.0)

3、Camunda BPM Spring Boot Starter: (v3.2.1)

4、Spring Clound: (Greenwich.RELEASE)

5、JDK: (v1.8)

6、Mysql: (v5.7)

7、其他见pom.xml

一、用IDEA创建maven项目

  • 添加Camunda和Spring Boot依赖项
  • 添加一个主类作为启动Spring Boot应用程序的入口点。
  • <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-dependencies</artifactId>
          <version>${spring-boot.version}</version>
          <type>pom</type>
          <scope>import</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>
    
    <dependencies>
      <dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
        <version>${camunda.spring-boot.version}</version>
      </dependency>
      <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
      </dependency>
      <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.2.3</version>
      </dependency>
    </dependencies>

     

二、将主类添加到我们的Spring Boot应用程序中

@SpringBootApplication
public class WebappExampleProcessApplication {

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

}

 三、生成并运行

生成成功后可以访问:localhost:8080

注意:这个JAR是一个Spring Boot应用程序,它作为Web容器,Camunda引擎和Camunda Web应用程序资源嵌入到Tomcat中。启动时,它将使用内存中的H2数据库满足Camunda Engine的需求。 

如果你启动失败:最可能的原因就是pom.xml 里面注入的数据库不是h2;

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值