【Camunda工做流(1)工做筆記:SpringBoot整合Camunda】

Camunda BPM 與 Spring Boot 集成示例
本示例是根據 camunda.org官網Spring Boot集成入門指引建立的。java

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

##本示例組件github

一、Spring-Boot: (v2.2.1.RELEASE)web

二、Camunda BPM: (v7.12.0)spring

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

四、Spring Clound: (Greenwich.RELEASE)數據庫

五、JDK: (v1.8)springboot

六、Mysql: (v5.7)app

七、其餘見pom.xml
webapp

1、用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>

     

2、將主類添加到咱們的Spring Boot應用程序中

@SpringBootApplication
public class WebappExampleProcessApplication {

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

}

 3、生成並運行

生成成功後能夠訪問:localhost:8080

注意:這個JAR是一個Spring Boot應用程序,它做爲Web容器,Camunda引擎和Camunda Web應用程序資源嵌入到Tomcat中。啓動時,它將使用內存中的H2數據庫知足Camunda Engine的需求。 

若是你啓動失敗:最可能的緣由就是pom.xml 裏面注入的數據庫不是h2;

相關文章
相關標籤/搜索