activiti定时边界事件
<?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> <process id="myProcess" name="My process" isExecutable="true"> <startEvent id="startevent1" name="Start"></startEvent> <userTask id="usertask1" name="1" activiti:assignee="lingling"></userTask> <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow> <boundaryEvent id="boundarytimer1" name="Timer" attachedToRef="usertask1" cancelActivity="false"> <timerEventDefinition> <timeDuration>${timeDuration}</timeDuration> </timerEventDefinition> </boundaryEvent> <userTask id="usertask2" name="2" activiti:assignee="dongxh"></userTask> <sequenceFlow id="flow4" sourceRef="usertask1" targetRef="usertask2"></sequenceFlow> <endEvent id="endevent1" name="End"></endEvent> <sequenceFlow id="flow5" sourceRef="usertask2" targetRef="endevent1"></sequenceFlow> <boundaryEvent id="boundarytimer2" name="Timer" attachedToRef="usertask2" cancelActivity="false"> <timerEventDefinition> <timeDuration>${timeDuration}</timeDuration> </timerEventDefinition> </boundaryEvent> <serviceTask id="servicetask1" name="Service Task" activiti:delegateExpression="${swTimeOutProcessorListener}"></serviceTask> <sequenceFlow id="flow6" sourceRef="boundarytimer1" targetRef="servicetask1"></sequenceFlow> <sequenceFlow id="flow7" sourceRef="boundarytimer2" targetRef="servicetask1"></sequenceFlow> </process> <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess"> <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess"> <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> <omgdc:Bounds height="35.0" width="35.0" x="60.0" y="80.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> <omgdc:Bounds height="35.0" width="35.0" x="660.0" y="80.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> <omgdc:Bounds height="78.0" width="105.0" x="202.0" y="59.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="boundarytimer1" id="BPMNShape_boundarytimer1"> <omgdc:Bounds height="30.0" width="30.0" x="230.0" y="130.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2"> <omgdc:Bounds height="55.0" width="105.0" x="411.0" y="70.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="boundarytimer2" id="BPMNShape_boundarytimer2"> <omgdc:Bounds height="30.0" width="30.0" x="449.0" y="114.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1"> <omgdc:Bounds height="55.0" width="105.0" x="317.0" y="240.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> <omgdi:waypoint x="95.0" y="97.0"></omgdi:waypoint> <omgdi:waypoint x="202.0" y="98.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4"> <omgdi:waypoint x="307.0" y="98.0"></omgdi:waypoint> <omgdi:waypoint x="411.0" y="97.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5"> <omgdi:waypoint x="516.0" y="97.0"></omgdi:waypoint> <omgdi:waypoint x="660.0" y="97.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6"> <omgdi:waypoint x="245.0" y="160.0"></omgdi:waypoint> <omgdi:waypoint x="369.0" y="240.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7"> <omgdi:waypoint x="464.0" y="144.0"></omgdi:waypoint> <omgdi:waypoint x="369.0" y="240.0"></omgdi:waypoint> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </definitions>
流程图:
serviceTask处理:
@Component public class SwTimeOutProcessorListener implements JavaDelegate { @Autowired private TimeOutManagerService timeOutManagerService; @Autowired private TaskService taskService; @Override public void execute(DelegateExecution execution) throws Exception { //获得事务id String businessKey = execution.getProcessBusinessKey(); Task task = taskService.createTaskQuery().processInstanceId(execution.getProcessInstanceId()).singleResult(); String assignee =task.getAssignee(); System.out.println(assignee); //插入超时记录 //timeOutManagerService.addTimeOut(Integer.valueOf(assignee), Integer.valueOf(businessKey)); } }
定时边间事件:cancelActivity 说明:
cancelActivity属性:true时,当timer触发时,当前的activity被中断(流程结束);
false时,当timer触发时,不会被中断(流程原点,流程不会结束),
当执行循环定时器时,虽然cancelActivity=true,但是该acitivity还是会持续生成
cancelActivity默认为true中断事件(结束流程)
cancelActivity为false非中断事件(还停留在原地,流程不结束)
中断和非中断的事件还是有区别的。默认是中断事件。
非中断事件的情况,不会中断原始环节,那个环节还停留在原地。 对应的,会创建一个新分支,并沿着事件的流向继续执行。
例子:
相关推荐
activiti没有撤回,由于业务的需求需要实现撤回,在参考别人代码后以两种方式实现了任意...5、领取任务,完成任务 6、删除当前节点的流向,将流向还原成临时变量oldPvmTransitionList中的值 第二种方式具体看代码。。。
Spring cloud和流程引擎activiti5整合代码二,事件网关,定时事件和信号事件
Activiti多实例任务实现会签.
activiti学习-使用activiti多实例任务实现会签
Activiti5Activiti5
Activiti5视频教程 百度网盘地址 还有资料
activiti5数据库表结构,activiti5数据库表结构activiti5数据库表结构
Activiti5学习笔记
activiti5工作流官方文档汉化版activiti5工作流官方文档汉化版
Activiti 学习笔记13:分配组任务
Activiti5 下 Activiti Modeler 汉化配置文件 stencilset.json 建议先备份原文件,之后替换即可
包括:Activiti5的10分钟入门指南(转载);Activiti5学习笔记;Activiti5与SSH的整合笔记。
结合eclipse的截图 该文档详细的描述了工作流引擎Activiti5的使用说明
ssh 整合 activiti5 的 demo 是Maven项目,刚接触activiti 的可以参考下..
Activiti 学习笔记12:个人任务
工作流 实例 activiti 5 工作流的部署 运行 历史查询 流程图 实例介绍
该系统功能强大,该系统基于Activiti5工作流编写的财务审批系统,该系统可以进行二次开发
activiti 5 用户手册 技术文档 教程
Springboot2整合Activiti5设计器,包括代码和指南,笔者使用的Springboot版本为2.0.3 Release,activiti版本为5.22.0,JDK1.8。
此项目为springmvc、Mybatis、EHcache、maven、Spring security3、activiti5工作流的整合 是一个基于数据库的权限管理demo项目、使用mysql数据库 项目运行前需要构建maven私服 而且有些jar包私服中肯定没有,需要...