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 < ...
随机推荐
- Spark的运行模式(2)--Yarn-Cluster和Yarn-Client
3. Yarn-Cluster Yarn是一种统一资源管理机制,可以在上面运行多种计算框架.Spark on Yarn模式分为两种:Yarn-Cluster和Yarn-Client,前者Driver运 ...
- 算法笔记_218:花朵数(Java)
目录 1 问题描述 2 解决方案 1 问题描述 一个N位的十进制正整数,如果它的每个位上的数字的N次方的和等于这个数本身,则称其为花朵数.例如:当N=3时,153就满足条件,因为 1^3 + 5^ ...
- Python使用SSL方式发送QQ邮箱
#coding:utf-8 import smtplib from email.mime.text import MIMEText from email.header import Header # ...
- Ulua_toLua_基本案例(二)_ScriptsFromFile
在Untiy中用Lua.必需要LuaInterface. LuaInterface的介绍请看:点击打开链接 能够先光写Lua,生成.lua的纯文件. 再Unity中通过,luaState.DoFile ...
- 使用 axios 详解
Vue.js 1.0 我们常使用 vue-resource (官方ajax库), Vue 2.0 发布后作者宣告不再对 vue-resource 进行更新, 推荐我们使用 axios (基于 Prom ...
- java sm3加密算法
java sm3加密算法实现 CreationTime--2018年7月13日09点28分 Author:Marydon 1.准备工作 所需jar包: bcprov-jdk15on-1.59.ja ...
- java 从spring容器中获取注入的bean对象
java 从spring容器中获取注入的bean对象 CreateTime--2018年6月1日10点22分 Author:Marydon 1.使用场景 控制层调用业务层时,控制层需要拿到业务层在 ...
- 由一次 symbol lookup error 引发的思考
开发一个跨平台的项目的时候,大部分时候都是在VS下进行编码,所以也就使用了VS的解决方案来管理项目. 因为要跨平台,当时网上看scons这个工具不错,所以在linux下就使用了scons来作为编译脚本 ...
- 【转】IP地址、子网掩码、网络号、主机号、网络地址、主机地址以及ip段
背景知识 IP地址 IP地址被用来当做Internet上的电脑的身份编号.大家日常见到的情况是每台联网的PC上都需要有IP地址,才能正常通信.我们可以把“个人电脑”比作“一台电话”,那么“IP地址”就 ...
- 转:Delta3D Editor编译成功
下载: 官网 www.delta3d.org 有些地方访问不了(试试这个代理:133.1.74.163 3128),我在公司就访问不了,但是住的地方就可以.但是sourceforge是可以访问 ...