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&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;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配置的更多相关文章

  1. flowable学习笔记-简单流程概念介绍

    1 Flowable process engine允许我们创建ProcessEngine 对象和使用 Flowable 的API ProcessEngine是线程安全的,他是通过 ProcessEng ...

  2. flowable 6.1.2 命令行完成请假审批流程的例子

    一.创建 eclipse maven新项目 1.设置项目选项 其中,Create a simple project 要选中. 2.填写项目包名和项目名称 这里的Group id:必须是 org.flo ...

  3. flowable的多人会签和一票否决

    项目结构: 接下来代码: Duorenhuiqian.bpmn20.xml: <?xml version="1.0" encoding="UTF-8"?& ...

  4. Flowable实战(一)启动第一个完整流程

    一.前言:   发现网上关于Flowable的资料基本都是浅尝辄止,对如何构建一个企业级的流程应用说明很少,所以写个实战系列,希望对大家和自己,都有所帮助. 二.认识Flowable   Flowab ...

  5. flowable流程启动时监听器

    一.核心配置类 package com.magus.project.flow.config; import com.google.common.collect.Maps; import com.mag ...

  6. 【流程】Flowable流程定义总结

    背景 近几年,互联网企业从消费互联网向产业互联网转型.在消费互联网时期,企业面对的时C端消费者,而产业互联网面对的是B端用户. 产业互联网涉及方方面面,企业信息化的建设就是B端用户的业务之一,在企业就 ...

  7. SSH整合JBPM4.4

    第一步:导入所需jar包: 所需的jar包(使用了hibernate annotation和struts2的convention-plugin,可能有多余的包,没做清理): 第二步:修改jbpm配置文 ...

  8. 【Activiti学习之八】Spring整合Activiti

    环境 JDK 1.8 MySQL 5.6 Tomcat 8 idea activiti 5.22 activiti-explorer是官方提供的一个演示项目,可以使用页面管理Activiti流程.ac ...

  9. Activiti创建表(三)

    创建Mysql 创建 mysql 数据库 activiti(名字任意):CREATE DATABASE activiti DEFAULT CHARACTER SET utf8; pom.xml < ...

随机推荐

  1. angularJS 事件广播与接收[转]

    路由的事件 事件这个词在前端出现的频率真是高,根本拦不住,哪都是.$route服务在路由过程中的每个阶段都会触发不同的事件,可以为这些不同的路由事件设置监听器并做出响应. 一共有4个事件用来监听路由的 ...

  2. 如何设置Vmware下Linux系统全屏显示

    环境:Vmware10+RedHat5 在Vmware10中安装好RedHat5后,即使点击了全屏按钮(或使用快捷键Ctrl+Alt+Enter),全屏的效果依然不尽人意,跟下图中差不多,RedHat ...

  3. 如何进入docker容器

    http://blog.csdn.net/u010397369/article/details/41045251

  4. 数组排序 -- 结合sort和函数排序

    结合sort和函数排序: 数组由小到大进行排序:sort,sortnum; var arr = [3,43,23,45,65,90]; function sortnum(a,b){ return a- ...

  5. Hibernate学习笔记五:反向工程快速开发

    转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6768513.html  一:反向工程 Myeclipse提供由 数据库表 生成 java pojo 和 hib ...

  6. auto function -> return type 当不能从{}内推断类型时

    示例: template<class F, class... Args> auto ThreadPool::enqueue(F&& f, Args&&... ...

  7. Flash Actionscript 多线程Worker 压缩图片

    package { import flash.display.Bitmap; import flash.display.Sprite; import flash.events.Event; impor ...

  8. 使用SHA256WithRSA来签名和验签(.NET/C#)

    RSACryptoServiceProvider does work with SHA2-based signatures, but you have to invest some effort in ...

  9. .NET/ASP.NET/C#/WCF/SQL Server/My SQL/Java/JSP/JDBC/Spring/Spring MVC/PHP/Python/Ruby/Shell/Agile/CSS/HTML/HTTP/Unix/Linux大量PDF书籍/电子书籍下载, Effective Java 下载

    223本电子书籍,囊括了.NET/ASP.NET/C#/WCF/SQL Server/My SQL/Java/JSP/JDBC/Spring/Spring MVC/PHP/Python/Shell/A ...

  10. javascript之QUnit单元测试

    一.javascript也需要单元测试吗? 这里我并不知道你有没有开发过大型的javascript项目,至今我开发过三个大型的js项目,分为是<课程节点树管理>.<在线制作试卷> ...