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