【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;

相关文章
相关标签/搜索