Activiti系列:是否可以让某些流程的信息写到历史表,而另外一些不写?
public void recordProcessInstanceStart(ExecutionEntity processInstance) {
if(isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
HistoricProcessInstanceEntity historicProcessInstance = new HistoricProcessInstanceEntity(processInstance);
// Insert historic process-instance
getDbSqlSession().insert(historicProcessInstance);
....
}
public boolean isHistoryLevelAtLeast(HistoryLevel level) {
if(log.isDebugEnabled()) {
log.debug("Current history level: {}, level required: {}", historyLevel, level);
}
// Comparing enums actually compares the location of values declared in the enum
return historyLevel.isAtLeast(level);
}
/**
* Enum that contains all possible history-levels.
*
* @author Frederik Heremans
*/
public enum HistoryLevel {
NONE("none"),
ACTIVITY("activity"),
AUDIT("audit"),
FULL("full");
private String key;
private HistoryLevel(String key) {
this.key = key;
}
/**
* @param key string representation of level
* @return {@link HistoryLevel} for the given key
* @throws ActivitiException when passed in key doesn't correspond to existing level
*/
public static HistoryLevel getHistoryLevelForKey(String key) {
for(HistoryLevel level : values()) {
if(level.key.equals(key)) {
return level;
}
}
throw new ActivitiIllegalArgumentException("Illegal value for history-level: " + key);
}
/**
* String representation of this history-level.
*/
public String getKey() {
return key;
}
/**
* Checks if the given level is the same as, or higher in order than the
* level this method is executed on.
*/
public boolean isAtLeast(HistoryLevel level) {
// Comparing enums actually compares the location of values declared in the enum
return this.compareTo(level) >= 0;
}
}
Activiti系列:是否可以让某些流程的信息写到历史表,而另外一些不写?的更多相关文章
- 玩转Windows服务系列——服务运行、停止流程浅析
通过研究Windows服务注册卸载的原理,感觉它并没有什么特别复杂的东西,Windows服务正在一步步退去它那神秘的面纱,至于是不是美女,大家可要睁大眼睛看清楚了. 接下来研究一下Windows服务的 ...
- Activiti工作流学习(二)流程实例、执行对象、任务
一.前言 前面说明了基本的流程部署.定义,启动流程实例等基本操作,下面我们继续来学习流程实例.执行对象.任务. 二.流程实例.执行对象说明 整个Activiti的生命周期经过了如下的几个步骤: 1.流 ...
- activiti系列导读
此用于管理activiti系列标签文章,activiti的分析是建立在目前最新的版本5.21之上. 官方指导手册链接:http://www.activiti.org/userguide/index.h ...
- 玩转Windows服务系列——服务运行、停止流程浅析
原文:玩转Windows服务系列——服务运行.停止流程浅析 通过研究Windows服务注册卸载的原理,感觉它并没有什么特别复杂的东西,Windows服务正在一步步退去它那神秘的面纱,至于是不是美女,大 ...
- Activiti进阶(二)——部署流程资源的三种方式
转自:http://blog.csdn.net/zjx86320/article/details/50234707 流程资源可以是各种类型的文件,在启动流程或流程实例运行过程中会被读取.下面介绍常用的 ...
- 【Activiti学习之七】BPMN子流程、顺序流、流程关口
环境 JDK 1.8 MySQL 5.6 Tomcat 7 Eclipse-Luna activiti 6.0 一.子流程 1.嵌入子流程2.调用子流程3.事件子流程4.事务子流程 二.顺序流1.条件 ...
- Spring框架系列(5) - 深入浅出SpringMVC请求流程和案例
前文我们介绍了Spring框架和Spring框架中最为重要的两个技术点(IOC和AOP),那我们如何更好的构建上层的应用呢(比如web 应用),这便是SpringMVC:Spring MVC是Spri ...
- Activiti工作流框架学习(一)——环境的搭建和数据表的了解
一.什么是工作流 工作流(Workflow),就是“业务过程的部分或整体在计算机应用环境下的自动化”,它主要解决的是“使在多个参与者之间按照某种预定义的规则传递文档.信息或任务的过程自动进行,从而实现 ...
- JS组件系列——表格组件神器:bootstrap table(二:父子表和行列调序)
前言:上篇 JS组件系列——表格组件神器:bootstrap table 简单介绍了下Bootstrap Table的基础用法,没想到讨论还挺热烈的.有园友在评论中提到了父子表的用法,今天就结合Boo ...
随机推荐
- centos7安装python-pip
在使用centos7的软件包管理程序yum安装python-pip的时候会报一下错误: No package python-pip available. Error: Nothing to do 说没 ...
- 烂泥:KVM虚拟机windows系统增加硬盘
本文由秀依林枫提供友情赞助,首发于烂泥行天下. 前一篇文章介绍了有关linux系统添加硬盘的方法,这次我们来介绍有关windows系统添加的相关步骤. 其实linux和windows添加的硬盘的方法都 ...
- linux基本命令学习笔记
这个几天在研究linux的常用基本命令.以下是此时间内的幻灯片截图笔记,在这里留个脚印. linux 常用命令 1,命令的基本格式 2,文件处理命令 3,文件搜索命令 4,帮助命令 5,压缩解压缩命令 ...
- 字符串_KMP算法(求next[]模板 hdu 1711)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1711 问题描述:给两个序列a,b,长度分别为n,m(1<=n<=1000000,1< ...
- python split()函数使用拆分字符串 将字符串转化为列表
函数:split()Python中有split()和os.path.split()两个函数,具体作用如下:split():拆分字符串.通过指定分隔符对字符串进行切片,并返回分割后的字符串列表(list ...
- iOS开发-简单解析JSON数据
什么是JSON JSON是一种轻量级的数据格式,一般用于数据交互 服务器返回给客户端的数据,一般都是JSON格式或者XML格式(文件下载除外) JSON的格式很像OC中的字典和数组 {“nam ...
- linux内核宏container_of
首先来个简单版本 /* given a pointer @ptr to the field @member embedded into type (usually * struct) @type, r ...
- 浅谈export 以及环境变量
简要说一下env,set,export的区别:env命令显示环境变量,set和export显示环境变量和自定变量. export:可以讲自定变量转化为环境变量之前有一个疑惑,我们定义环境变量PATH时 ...
- 《TCP/IP 详解 卷一》读书笔记-----IP静态 路由
1.主机中的路由表只能被守护进程routing daemon或者“redirect”类型的ICMP报文所更新. 2.在根据路由表进行路由选择时,判断的优先级从高到低依次为1)表中存在与目的IP完全匹配 ...
- 该怎样提高ZBrush的创作效率
ZBrush是一款数字雕刻和绘画软件,以强大的功能和直观的工作流程改变了整个三维行业,相信使用ZBrush的人都希望加快雕刻速度提高ZBrush技能,很多雕刻专家也都试图证明加快雕刻速度是否真的能提 ...