Flowable边界事件-定时边界事件

定时边界事件

  • 定时边界事件
  • 一、定义
    • 1. 图形标记
    • 2. 完整的流程图
    • 3. XML标记
  • 二、测试用例
    • 2.1 定时边界事件xml文件
    • 2.2 定时边界事件测试用例
  • 总结


定时边界事件


一、定义

时间达到设定的时间之后触发事件

由于定时边界事件和开始定时事件几乎差不多,四种情况我就不一一讲解

1. 图形标记

Flowable边界事件-定时边界事件_第1张图片

2. 完整的流程图

Flowable边界事件-定时边界事件_第2张图片

3. XML标记

定时边界事件的XML

  <boundaryEvent id="Event_01nhjkv" attachedToRef="Activity_03g2u4u">
      <timerEventDefinition>
        <timeDuration>PT1MtimeDuration>
      timerEventDefinition>
    boundaryEvent>

二、测试用例

2.1 定时边界事件xml文件


<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.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" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://flowable.org/bpmn">
  <process id="TimerBoundaryEventProcess" name="边界定时事件" isExecutable="true">
    <startEvent id="a01d45da481a343d4b83577eb6693606f">
      <extensionElements>
        <flowable:formData />
      extensionElements>
    startEvent>
    <userTask id="a9da783ed85bb42f6b2ca4ad782f54344" name="提交人">
      <extensionElements>
        <flowable:formData />
        <flowable:assigneeType>staticflowable:assigneeType>
      extensionElements>
    userTask>
    <sequenceFlow id="a87af96ca53924ad9a1525a41e308bdae" sourceRef="a01d45da481a343d4b83577eb6693606f" targetRef="a9da783ed85bb42f6b2ca4ad782f54344" />
    <userTask id="Activity_03g2u4u" name="任务审批">
      <extensionElements>
        <flowable:formData />
        <flowable:assigneeType>staticflowable:assigneeType>
      extensionElements>
    userTask>
    <sequenceFlow id="Flow_1s4seva" sourceRef="a9da783ed85bb42f6b2ca4ad782f54344" targetRef="Activity_03g2u4u" />
    <endEvent id="Event_0cqe6ya" />
    <sequenceFlow id="Flow_0pq0z0t" sourceRef="Activity_03g2u4u" targetRef="Event_0cqe6ya" />
    <userTask id="Activity_1jj3bkp" name="定时边界之后的任务">
      <extensionElements>
        <flowable:formData />
        <flowable:assigneeType>staticflowable:assigneeType>
      extensionElements>
    userTask>
    <sequenceFlow id="Flow_10bz99f" sourceRef="Event_01nhjkv" targetRef="Activity_1jj3bkp" />
    <sequenceFlow id="Flow_12m14oj" sourceRef="Activity_1jj3bkp" targetRef="Event_0cqe6ya" />
    <boundaryEvent id="Event_01nhjkv" attachedToRef="Activity_03g2u4u">
      <timerEventDefinition>
        <timeDuration>PT1MtimeDuration>
      timerEventDefinition>
    boundaryEvent>
  process>

2.2 定时边界事件测试用例

 ProcessDefinition processDefinition = this.deployByModelKey("TimerBoundaryEventProcess");

        ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinition.getId());
        Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();

        taskService.complete(task.getId());


        task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
        log.info("当前任务名称:{}", task.getName());

总结

时间达到预设的时间标准之后触发事件。

注意:边界事件中断和非中断 默认是中断事件 设置了属性cancelActivity="false"的时候为非中断事件
1、中断事件是中断当前的活动沿着事件触发
2、非中断事件是不影响当前活动,并沿着事件触发

欢迎加入QQ群学习交流:582010059

你可能感兴趣的:(Flowable组件库,flowable,工作流引擎,bpmnjs)