camunda工作流引擎开发之旅01
camunda工作流引擎开发之旅01背景:后端项目使用springboot+camunda来搭建,如果有微服务需求的,可以自己加上eureka和springcloud等大家庭。
camunda工作流引擎开发之旅01
背景:后端项目使用springboot+camunda来搭建,如果有微服务需求的,可以自己加上eureka和springcloud等大家庭。
目前maven所用到的依赖:
<properties>
<java.version>1.8</java.version>
<camunda.spring-boot.version>3.2.1</camunda.spring-boot.version>
<spring-boot.version>2.1.1.RELEASE</spring-boot.version>
<spring.cloud.version>Greenwich.RELEASE</spring.cloud.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<hk2.version>2.5.0</hk2.version>
<mysql-connector.version>5.1.47</mysql-connector.version>
<camunda-swagger.version>7.8.0</camunda-swagger.version>
<camunda-spin.version>1.6.6</camunda-spin.version>
<swagger-ui.version>3.20.9</swagger-ui.version>
<springfox.version>2.9.2</springfox.version>
<fastjson.version>1.2.31</fastjson.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</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>
<!--mybatis 依赖-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
<version>${camunda.spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
<version>${camunda.spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.camunda.spin</groupId>
<artifactId>camunda-spin-dataformat-all</artifactId>
<version>${camunda-spin.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2</artifactId>
<version>${hk2.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>spring-bridge</artifactId>
<version>${hk2.version}</version>
</dependency>
<dependency>
<groupId>org.camunda.bpm.extension.swagger</groupId>
<artifactId>camunda-bpm-swagger-json</artifactId>
<version>${camunda-swagger.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>${swagger-ui.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-impl</artifactId>
<version>2.2.7</version>
</dependency>
</dependencies>
主要有springboot家庭的,还有mybatis与mysql的,项目的背景主要就是建立一个后端的camunda引擎项目,用于学习以及给前端做工作流业务使用。
camunda脱胎于activiti,我本来是看了一点activiti的api,后面转camunda的时候,毫无阻塞,而camunda的社区也更友好点,更新也强点,就选定了camunda。
camunda主要学习方式通过它的官方api,只是api纯英文,大佬们可以自行翻看
camunda支持自动扫描resources下的bpmn文件,在项目启动时自动部署到环境中,如果有改动的bpmn,则算是版本更新,我项目主要是从前端进行部署bpmn,所以此功能被我在配置文件中关闭了。
具体可在processes.xml的false以及application.yaml中camunda.bpm.auto-deployment-enabled: false来设置,测试过发现只要在yml中设置了即不会自动部署了。
yml配置:
server:
port: 8080
tomcat:
uri-encoding: UTF-8
servlet:
context-path: /camundaDemo
spring:
application:
name: camunda-demo-service
jersey:
application-path: /engine-rest
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/camunda_demo2?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&useOldAliasMetadataBehavior=true
username: root
password: ***
tomcat:
max-idle: 10
max-wait: 10000
min-idle: 5
initial-size: 5
validation-query: SELECT 1
test-on-borrow: false
test-while-idle: true
time-between-eviction-runs-millis: 18800
camunda.bpm:
filter:
create: All tasks
database:
type: mysql
admin-user:
id: cheey
password: superSecret
firstName: cheey
auto-deployment-enabled: false
webapp:
index-redirect-enabled: false
mybatis:
typeAliasesPackage: com.fs.camunda.bpm.example.entity
mapper-locations: classpath:mybatis/mapper/*.xml
application-path: /engine-rest是web端访问rest api必须加上的路径,
admin-user这类的是基于jar中加载了自己的camunda web端配置的账号密码,程序运行时会自动在数据库创建,web端也可以关闭
webapp:
index-redirect-enabled: false 这就是关闭web端
这篇就先说配置文件了
更多推荐
所有评论(0)