SpringBoot2整合activiti6环境搭建

SpringBoot2整合activiti6环境搭建

依赖

1<dependencies> 2 <dependency> 3 <groupId>org.springframework.boot</groupId> 4 <artifactId>spring-boot-starter-web</artifactId> 5 </dependency> 6 <dependency> 7 <groupId>org.activiti</groupId> 8 <artifactId>activiti-spring-boot-starter-basic</artifactId> 9 <version>${activiti.version}</version> 10 </dependency> 11 <dependency> 12 <groupId>org.springframework.boot</groupId> 13 <artifactId>spring-boot-starter-jdbc</artifactId> 14 </dependency> 15 <!-- mysql驱动 --> 16 <dependency> 17 <groupId>mysql</groupId> 18 <artifactId>mysql-connector-java</artifactId> 19 </dependency> 20 </dependencies>

这里使用的springboot2.0.6的版本,activiti为6.0.0的版本

添加processes目录

SpringBoot集成activiti默认会从classpath下的processes目录下读取流程定义文件,所以需要在src/main/resources目录下添加processes目录,并在目录中创建流程文件

application.yml

1spring: 2 activiti: 3 check-process-definitions: true #自动检查、部署流程定义文件 4 database-schema-update: true #自动更新数据库结构 5 #流程定义文件存放目录 6 process-definition-location-prefix: classpath:/processes/ 7 #process-definition-location-suffixes: #流程文件格式 8 datasource: 9 driver-class-name: com.mysql.jdbc.Driver 10 url: jdbc:mysql://127.0.0.1:3306/taosir_process?useUnicode=true&useSSL=false&characterEncoding=utf8 11 username : root 12 password : root 13 initsize : 10 14 maxActive : 20 15 minIdle : 10 16 maxWait : 120000 17 poolPreparedStatements : false 18 maxOpenPreparedStatements : -1 19 validationQuery : select 1 20 testOnborrow : true 21 testOnReturn : true 22 testWhileIdle : true 23 timeBetweenEvictionRunsMillis : 120000 24server: 25 port: 8764

bpmn文件

1<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 2<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="Examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1539757531057" name="" targetNamespace="Examples" typeLanguage="http://www.w3.org/2001/XMLSchema"> 3 <process id="oneTaskProcess" isClosed="false" name="The One Task Process" processType="None"> 4 <startEvent id="theStart"/> 5 <sequenceFlow id="flow1" sourceRef="theStart" targetRef="theTask"/> 6 <userTask activiti:assignee="${user}" activiti:exclusive="true" id="theTask" name="my task"/> 7 <sequenceFlow id="flow2" sourceRef="theTask" targetRef="theEnd"/> 8 <endEvent id="theEnd"/> 9 </process> 10</definitions>

启动类,注意@SpringBootApplication注解需要设置exclude属性

1package cn.zytao.taosir.process; 2 3import org.activiti.spring.boot.SecurityAutoConfiguration; 4import org.springframework.boot.SpringApplication; 5import org.springframework.boot.autoconfigure.SpringBootApplication; 6 7@SpringBootApplication(exclude = SecurityAutoConfiguration.class) 8public class ProcessApplication { 9 public static void main(String[] args) { 10 SpringApplication.run(ProcessApplication.class, args); 11 } 12}
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )