• Flowable工作流之任务回退


    1. 前言

    有的时候,一个任务节点会存在多个候选人,例如 zhangsan 提交一个任务,这个任务既可以 lisi 处理,又可以 wangwu 处理,当一个候选人认领任务之后,但是又不想处理任务了,此时我们可以将任务回退,那么针对这种情况,我们该如何处理?今天一起来看看

    2. Flowable 中的任务回退

    2.1. 串行的回退

    2.1.1. 流程图

    我们先从最简单的串行流程来分析,案例流程图如下

    在这里插入图片描述
    完整的 xml 文件内容

    
    <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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"
                 typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath"
                 targetNamespace="http://www.flowable.org/processdef" exporter="Flowable Open Source Modeler"
                 exporterVersion="6.7.2">
        <process id="TaskFallback" name="TaskFallback" isExecutable="true">
            <documentation>flowable中任务的回退documentation>
            <startEvent id="sid-28824261-2B78-4304-A8A5-3C16F52D9797" flowable:formFieldValidation="true">startEvent>
            <userTask id="userTaskId1" name="用户任务1" flowable:assignee="${user1}" flowable:formFieldValidation="true">
                <extensionElements>
                    <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler">
                        modeler:initiator-can-complete>
                extensionElements>
            userTask>
            <sequenceFlow id="sid-600A5337-2246-4AD7-A042-0936186F4327" sourceRef="sid-28824261-2B78-4304-A8A5-3C16F52D9797"
                          targetRef="userTaskId1">sequenceFlow>
            <userTask id="userTaskId2" name="用户任务2" flowable:assignee="${user2}" flowable:formFieldValidation="true">
                <extensionElements>
                    <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler">
                        modeler:initiator-can-complete>
                extensionElements>
            userTask>
            <sequenceFlow id="sid-A816C5B2-796D-49AB-A5BB-18D3A59809A2" sourceRef="userTaskId1"
                          targetRef="userTaskId2">sequenceFlow>
            <userTask id="userTaskId3" name="用户任务3" flowable:assignee="${user3}" flowable:formFieldValidation="true">
                <extensionElements>
                    <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler">
                        modeler:initiator-can-complete>
                extensionElements>
            userTask>
            <sequenceFlow id="sid-A5EE9D1F-5B60-4741-9CBA-3450BCD79851" sourceRef="userTaskId2"
                          targetRef="userTaskId3">sequenceFlow>
            <userTask id="userTaskId4" name="用户任务4" flowable:assignee="${user4}" flowable:formFieldValidation="true">
                <extensionElements>
                    <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler">
                        modeler:initiator-can-complete>
                extensionElements>
            userTask>
            <sequenceFlow id="sid-62FCA0CF-0A6F-4A81-BE80-85B251DE7E40" sourceRef="userTaskId3"
                          targetRef="userTaskId4">sequenceFlow>
            <endEvent id="sid-D326808D-3133-4907-84B4-1B6CE14EACF7">endEvent>
            <sequenceFlow id="sid-E025FC2C-2857-4377-9D87-37FCC68C6781" sourceRef="userTaskId4"
                          targetRef="sid-D326808D-3133-4907-84B4-1B6CE14EACF7">sequenceFlow>
        process>
        <bpmndi:BPMNDiagram id="BPMNDiagram_TaskFallback">
            <bpmndi:BPMNPlane bpmnElement="TaskFallback" id="BPMNPlane_TaskFallback">
                <bpmndi:BPMNShape bpmnElement="sid-28824261-2B78-4304-A8A5-3C16F52D9797"
                                  id="BPMNShape_sid-28824261-2B78-4304-A8A5-3C16F52D9797">
                    <omgdc:Bounds height="30.0" width="30.0" x="38.0" y="108.0">omgdc:Bounds>
                bpmndi:BPMNShape>
                <bpmndi:BPMNShape bpmnElement="userTaskId1" id="BPMNShape_userTaskId1">
                    <omgdc:Bounds height="80.0" width="100.0" x="135.0" y="83.0">omgdc:Bounds>
                bpmndi:BPMNShape>
                <bpmndi:BPMNShape bpmnElement="userTaskId2" id="BPMNShape_userTaskId2">
                    <omgdc:Bounds height="80.0" width="100.0" x="315.0" y="83.0">omgdc:Bounds>
                bpmndi:BPMNShape>
                <bpmndi:BPMNShape bpmnElement="userTaskId3" id="BPMNShape_userTaskId3">
                    <omgdc:Bounds height="80.0" width="100.0" x="495.0" y="83.0">omgdc:Bounds>
                bpmndi:BPMNShape>
                <bpmndi:BPMNShape bpmnElement="userTaskId4" id="BPMNShape_userTaskId4">
                    <omgdc:Bounds height="80.0" width="100.0" x="675.0" y="83.0">omgdc:Bounds>
                bpmndi:BPMNShape>
                <bpmndi:BPMNShape bpmnElement="sid-D326808D-3133-4907-84B4-1B6CE14EACF7"
                                  id="BPMNShape_sid-D326808D-3133-4907-84B4-1B6CE14EACF7">
                    <omgdc:Bounds height="28.0" width="28.0" x="855.0" y="109.0">omgdc:Bounds>
                bpmndi:BPMNShape>
                <bpmndi:BPMNEdge bpmnElement="sid-600A5337-2246-4AD7-A042-0936186F4327"
                                 id="BPMNEdge_sid-600A5337-2246-4AD7-A042-0936186F4327" flowable:sourceDockerX="15.0"
                                 flowable:sourceDockerY="15.0" flowable:targetDockerX="50.0" flowable:targetDockerY="40.0">
                    <omgdi:waypoint x="67.94999895119737" y="123.0">omgdi:waypoint>
                    <omgdi:waypoint x="135.0" y="123.0">omgdi:waypoint>
                bpmndi:BPMNEdge
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
  • 相关阅读:
    HMTL知识点系列(4)
    使用Python,dlib进行对象实时追踪
    Github霸榜一周,竟是阿里技术官的微服务分布式项目实战笔记总结
    StringRedisTemplate
    ConfigurationManager姿势快闪
    Android 唤醒屏幕的方式:屏幕锁 - WakeLock / FLAG_KEEP_SCREEN_ON
    R语言ggplot2可视化:使用ggpubr包的ggmaplot函数可视化MA图(MA-plot)、font.label参数设置图中标签字体类型、字体大小
    已解决 Microservice Error: Circuit Breaker: Service is temporarily unavailable
    制氢厂氢气泄漏安全监测:氢气传感器守护“氢”安全
    一般PCB基本设计流程说明
  • 原文地址:https://blog.csdn.net/weixin_38192427/article/details/127603289