上一章我们讲到用户任务分为个人任务和组任务,这一章我们来具体看看怎么使用组任务。
这里我们用到的流程还是最简单的审批流程:
方式一:定义流程时指定组任务候选人(该方式不够灵活,使用较少)
方式二:使用流程变量指定组任务候选人
流程图代码
<?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:xsd="http://www.w3.org/2001/XMLSchema" 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="groupTask1" name="GroupTask1" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
<userTask id="usertask1" name="审批" activiti:candidateUsers="#{userIds}"></userTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_groupTask1">
<bpmndi:BPMNPlane bpmnElement="groupTask1" id="BPMNPlane_groupTask1">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="410.0" y="40.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x<

本文详细介绍了在Activiti中如何处理组任务,包括三种分配方式:定义流程时指定组候选人、使用流程变量设定和通过监听类设置。通过具体的流程图和Java测试代码展示了每种方式的操作步骤,并总结了它们的特点。同时,提到了act_ru_identitylink和act_hi_identitylink表在记录个人任务和组任务办理人中的不同之处。
最低0.47元/天 解锁文章
1649

被折叠的 条评论
为什么被折叠?



