flowable 的ProcessEngine配置
1 flowable process engine 是通过 flowable.cfg.xml 配置文件配置的。在spring 环境中是使用 flowable-context.xml 配置文件的,
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine() 方法会从 classpath 中寻找配置文件 flowable.cfg.xml 进行创建。
说明:flowable.cfg.xml 配置文件必须包含一个 ID 为processEngineConfiguration 的bean
flowable.cfg.xml 配置文件内容如下
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="processEngineConfiguration"
class="org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration"> <property name="jdbcUrl" value="jdbc:mysql://196.131.9.62/flow1?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false" />
<property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
<property name="jdbcUsername" value="root" />
<property name="jdbcPassword" value="" /> <property name="databaseSchemaUpdate" value="true" /> <property name="asyncExecutorActivate" value="false" />
</bean> </beans>
2 将 flowable 与 springboot 集成
2.1 pom 文件如下
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.</modelVersion> <groupId>com.huitong</groupId>
<artifactId>flow1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging> <name>flow1 Maven Webapp</name>
<url>http://www.example.com</url> <properties>
<project.build.sourceEncoding>UTF-</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<flowable.version>6.3.</flowable.version>
</properties> <!-- Inherit defaults from Spring Boot -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0..RELEASE</version>
</parent> <dependencies>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter</artifactId>
<version>${flowable.version}</version>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency> <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.</version>
<scope>provided</scope>
</dependency> </dependencies> <build>
<finalName>flow1</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
2.2 application.yml 配置
server:
port: spring:
application:
name: flow
datasource:
url: jdbc:mysql://127.0.0.1:3306/flow2?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull
username: root
password: root123
hikari:
minimum-idle:
connection-timeout:
maximum-pool-size:
idle-timeout:
flowable:
#关闭定时任务JOB
async-executor-activate: false
database-schema-update: false
process:
#
definition-cache-limit:
2.3 获得常用的 service 类BaseService
@Service
public class BaseService { @Autowired
@Getter
private RepositoryService repositoryService; @Autowired
@Getter
private RuntimeService runtimeService; @Autowired
@Getter
private TaskService taskService; @Autowired
@Getter
private IdmIdentityService idmIdentityService; @Getter
@Autowired
private HistoryService historyService; @Autowired
@Getter
private ManagementService managementService; }
flowable 的ProcessEngine配置的更多相关文章
- flowable学习笔记-简单流程概念介绍
1 Flowable process engine允许我们创建ProcessEngine 对象和使用 Flowable 的API ProcessEngine是线程安全的,他是通过 ProcessEng ...
- flowable 6.1.2 命令行完成请假审批流程的例子
一.创建 eclipse maven新项目 1.设置项目选项 其中,Create a simple project 要选中. 2.填写项目包名和项目名称 这里的Group id:必须是 org.flo ...
- flowable的多人会签和一票否决
项目结构: 接下来代码: Duorenhuiqian.bpmn20.xml: <?xml version="1.0" encoding="UTF-8"?& ...
- Flowable实战(一)启动第一个完整流程
一.前言: 发现网上关于Flowable的资料基本都是浅尝辄止,对如何构建一个企业级的流程应用说明很少,所以写个实战系列,希望对大家和自己,都有所帮助. 二.认识Flowable Flowab ...
- flowable流程启动时监听器
一.核心配置类 package com.magus.project.flow.config; import com.google.common.collect.Maps; import com.mag ...
- 【流程】Flowable流程定义总结
背景 近几年,互联网企业从消费互联网向产业互联网转型.在消费互联网时期,企业面对的时C端消费者,而产业互联网面对的是B端用户. 产业互联网涉及方方面面,企业信息化的建设就是B端用户的业务之一,在企业就 ...
- SSH整合JBPM4.4
第一步:导入所需jar包: 所需的jar包(使用了hibernate annotation和struts2的convention-plugin,可能有多余的包,没做清理): 第二步:修改jbpm配置文 ...
- 【Activiti学习之八】Spring整合Activiti
环境 JDK 1.8 MySQL 5.6 Tomcat 8 idea activiti 5.22 activiti-explorer是官方提供的一个演示项目,可以使用页面管理Activiti流程.ac ...
- Activiti创建表(三)
创建Mysql 创建 mysql 数据库 activiti(名字任意):CREATE DATABASE activiti DEFAULT CHARACTER SET utf8; pom.xml < ...
随机推荐
- 命令行能运行,但是在crontab不能正常运行的问题
今天配置了一个crontab,但是怎么也不能执行,原因是环境变量的问题,记录一下. 解决问题的办法,在shell脚本添加: ################## . /etc/profile . ~/ ...
- 使用迭代器遍历List的时候修改List报ConcurrentModificationException异常原因分析
在使用Iterator来迭代遍历List的时候如果修改该List对象,则会报java.util.ConcurrentModificationException异常,下面看一个例子演示: package ...
- java 判断String字符串是不是json数据
java 判断String字符串是不是json数据 CreationTime--2018年8月24日18点23分 Author:Marydon JSONObject jo = null; try ...
- VBA 一个很神奇的东西
百度经验参考:http://jingyan.baidu.com/article/4ae03de32663953efe9e6b47.html 今天奇迹般的发现了VBA,都怪自己平时使用excle不够多, ...
- alias别名使用
rhel系列的别名使用,方便操作! 功能说明:设置指令的别名.语 法:alias [别名] = [指令名称]参 数 :若不加任何参数,则列出目前所有的别名设置.举 例 :ermao@lo ...
- PAC Manager的重生: Asbru
PAC Manager在2016年停更后, 在Ubuntu18.04上的各种bug就无人修复了. 我在Windows下对XShell是重度依赖, 而在Linux下没有其他更好的替代品. 在上一次安装1 ...
- Nosql数据库的四大分类及分布式数据库CAP原理
1. Nosql数据库的四大分类 2. 分布式数据库CAP原理 2.1 关系型数据库事务遵循的ACID规则 首先了解传统关系型数据库事务遵循的ACID规则: 原子性(Atomicity):事务里的所有 ...
- 阿里云ecs配置辅助网卡绑定公网ip地址
EIP直通车 前置条件:1.大家的实例是从经典迁移到VPC里面的,上古时期,经典实例大家购买实例的时候都是买了带宽的.而这种带宽一般情况下都是包年包月的,而且这种绑定在实例上的IP,我们把它叫做公网I ...
- jsp+easyui+DataGrid 例子
转自:https://blog.csdn.net/l3922768721/article/details/51597977 导入js和css <%@ page language="ja ...
- JSP、Servlet中的相对路径和绝对路径 页面跳转问题
转自:http://blog.csdn.net/wym19830218/article/details/5503533/ 1.JSP.Servlet中的相对路径和绝对路径 前提:假设你的Http地址为 ...