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. Java Spring Quartz 定时任务

    公司需要使用JAVA的WebServer完成简单的定时跑任务的工作.其他例如:每隔30分钟执行锁定用户解锁任务. Quartz 在开源任务调度框架中的翘首,它提供了强大任务调度机制,难能可贵的是它同时 ...

  2. JERSEY中文翻译(第一章、Getting Started、2.2)

    前言 这是jersey2.2的用户向导,我们会尽力维护它的更新并且也会增加新的章节.当阅读本用户指南的时候,也要参阅Jersey API 文档,额外的信息补充JERSEY的新特性和API 如果你想要为 ...

  3. Eclipse经常使用快捷键

    Eclipse经常使用快捷键 1几个最重要的快捷键 代码助手:Ctrl+Space(中文简体操作系统是Alt+/) 高速修正:Ctrl+1 单词补全:Alt+/ 打开外部Java文档:Shift+F2 ...

  4. Spring Boot 之 RESTfull API简单项目的快速搭建(一)

    1.创建项目 2.创建 controller IndexController.java package com.roncoo.example.controller; import java.util. ...

  5. GIT服务器实现web代码自动部署

    之前在一台vps服务器上面搭建了Git服务器,用来做代码管理,方便团队开发.但是问题也就相应的来了,使用git可以轻松的上传代码,而由于做的是web开发,每次还都得到服务器上把代码手动pull或者复制 ...

  6. java 日期Date类型比较大小

      java 日期Date类型比较大小 CreateTime--2018年5月31日16点39分 Author:Marydon import java.text.DateFormat; import ...

  7. Selenium得到当前页面的URL

    /** * getCurrentURL:(get the current page URL address). * @author huchan * @param driver --- the web ...

  8. MongoDB安装实录

      mongodb是nosql中的贵族,很受欢迎... 01.下载 官方:https://www.mongodb.com 社区版.企业版 https://www.mongodb.com/downloa ...

  9. C#代码实现邮箱验证C#中及一些常用的正则表达式

    .验证用户名和密码:("^[a-zA-Z]\w{5,15}$")正确格式:"[A-Z][a-z]_[0-9]"组成,并且第一个字必须为字母6~16位: .验证电 ...

  10. Linux-socket的close和shutdown区别及应用场景

    shutdown的定义 #include<sys/socket.h> int shutdown(int sockfd,int how); how的方式有三种分别是: SHUT_RD(0): ...