flowable ProcessEngine和ProcessEngineConfiguration
ProcessEngine是流程引擎,ProcessEngineConfiguration与前面四个引擎配置有些不同。
ProcessEngineConfiguration增加了邮件服务和httpClient的封装。
一、实例化
ProcessEngineConfiguration 提供了7个公共的静态方法用于实例化。
public static ProcessEngineConfiguration createStandaloneProcessEngineConfiguration() {
return new StandaloneProcessEngineConfiguration();
}
public static ProcessEngineConfiguration createStandaloneInMemProcessEngineConfiguration() {
return new StandaloneInMemProcessEngineConfiguration();
}
二、创建ProcessEngine
创建ProcessEngine的方法是在ProcessEngineConfiguration的子类 ProcessEngineConfigurationImpl中提供的。
@Override
public ProcessEngine buildProcessEngine() {
init();
ProcessEngineImpl processEngine = new ProcessEngineImpl(this);
...
return processEngine;
}
三、初始化服务
创建引擎过程调用init()方法时,初始化服务。
public void init() {
...
initServices();
...
}
public void initServices() {
initService(repositoryService);
initService(runtimeService);
initService(historyService);
initService(identityService);
initService(taskService);
initService(formService);
initService(managementService);
initService(dynamicBpmnService);
}
public void initService(Object service) {
if (service instanceof ServiceImpl) {
((ServiceImpl) service).setCommandExecutor(commandExecutor);
}
}
这些服务定义在 ProcessEngineConfigurationImpl 中:
protected RepositoryService repositoryService = new RepositoryServiceImpl();
protected RuntimeService runtimeService = new RuntimeServiceImpl();
protected HistoryService historyService = new HistoryServiceImpl(this);
protected IdentityService identityService = new IdentityServiceImpl(this);
protected TaskService taskService = new TaskServiceImpl(this);
protected FormService formService = new FormServiceImpl();
protected ManagementService managementService = new ManagementServiceImpl();
protected DynamicBpmnService dynamicBpmnService = new DynamicBpmnServiceImpl(this);
初始化使AbstractEngineConfiguration的 CommandExecutor传递到这些服务的父类 ServiceImpl 中。
这些服务随着 processEngineConfigurationImpl实例传递给 processEngin实例。
flowable ProcessEngine和ProcessEngineConfiguration的更多相关文章
- 流程开发Activiti 与SpringMVC整合实例
流程(Activiti) 流程是完成一系列有序动作的概述.每一个节点动作的结果将对后面的具体操作步骤产生影响.信息化系统中流程的功能完全等同于纸上办公的层级审批,尤其在oa系统中各类电子流提现较为明显 ...
- Spring实例化Bean的三种方式及Bean的类型
1.使用类构造器实例化 [默认的类构造器] <bean id=“orderService" class="cn.itcast.OrderServiceBean"/ ...
- Activit工作流学习例子
看了网上一些文章,动手操作了一遍,终于学会了Activit的一些常规使用. 一.Eclipse中的Activiti插件安装 Activiti有一个Eclipse插件,Activiti Eclipse ...
- activiti基础环境搭建创建数据库表及策略
博主使用为activiti5.22的版本. 1.创建maven工程. 2.在pom文件中引入所需要的包,如:activiti包.数据库包. 这是我引用的包: <dependencies> ...
- activiti基础--0------------------------------生成23张表
1.工作流activiti.cfg.xml配置文件 <beans xmlns="http://www.springframework.org/schema/beans" xm ...
- 工作流学习之入门demo
/** * Copyright (C), 2015-2018, XXX有限公司 * FileName: DemoMain * Author: happy * Date: 2018/6/23 16:33 ...
- Activiti工作流学习笔记(三)——自动生成28张数据库表的底层原理分析
原创/朱季谦 我接触工作流引擎Activiti已有两年之久,但一直都只限于熟悉其各类API的使用,对底层的实现,则存在较大的盲区. Activiti这个开源框架在设计上,其实存在不少值得学习和思考的地 ...
- flowable 的ProcessEngine配置
1 flowable process engine 是通过 flowable.cfg.xml 配置文件配置的.在spring 环境中是使用 flowable-context.xml 配置文件的, P ...
- flowable学习笔记-简单流程概念介绍
1 Flowable process engine允许我们创建ProcessEngine 对象和使用 Flowable 的API ProcessEngine是线程安全的,他是通过 ProcessEng ...
随机推荐
- Linux Shell脚本编程--字符串截取
Linux 的字符串截取很有用.有八种方法. 假设有变量 var=http://www.aaa.com/123.htm. 1. # 号截取,删除左边字符,保留右边字符. echo ${var#*//} ...
- C++开学第一次作业(5.4)
开学第一次作业(5.4) 代码传送门 题目 Create a program that asks for the radius of a circle and prints the area of t ...
- .net 数据缓存(二)之Redis部署
现在的业务系统越来复杂,大型门户网站内容越来越多,数据库的数据量也越来愈大,所以有了“大数据”这一概念的出现.但是我们都知道当数据库的数据量和访问过于频繁都会影响系统整体性能体验,特别是并发量高的系统 ...
- mybatis动态插入数据(使用trim标签)
知识点: 当向一张表里插入数据,传入的参数不固定时,使用到mybatis的动态插入(trim标签) 参考博客:https://blog.csdn.net/h12kjgj/article/details ...
- LeetCode——Counting Bits
Question Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calcu ...
- 程序员清理xcode垃圾命令
xcrun simctl list devices xcrun simctl delete unavailable
- 在 Linux 服务器上搭建和配置 Hadoop 集群
实验条件:3台centos服务器,jdk版本1.8.0,Hadoop 版本2.8.0 注:hadoop安装和搭建过程中都是在用户lb的home目录下,master的主机名为host98,slave的主 ...
- 关于JBoss的一些项目配置
1. 如何使用 IP:port 的形式访问项目 : [1] 在standalone.xml文件中,查找<interfaces>标签,添加如下节点 : <interface name= ...
- JavaScript encodeURIComponent()
■ 把字符串作为 URI 组件进行编码.JavaScript中有三个可以对字符串编码的函数,分别是: escape,encodeURI,encodeURIComponent,相应3个解码函数:unes ...
- VisualBrush
VisualBrush是一种比较特殊的笔刷,它的功能仍然是用来给元素填充图案,但它的内容却可以是各种控件(换言之:它可以使用各种控件来给元素填充图案). 你可以将它理解为一个普通的容器,但在它内部的所 ...