flowable工作流子流程介绍
工作流提供了子流程的调用,一种是内部子流程,可以让用户主要看主流程,保持业务清晰,另一种是引用外部子流程(call activity),复用外部流程功能。
工作中有用到flowable 6.5.06版本。
Bpmn文件:
<?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="sub">
<process id="subProcess" name="子流程调研" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
<userTask id="usertask1" name="【主管审批】"></userTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
<subProcess id="subprocess1" name="【子流程】">
<documentation>测试子流程</documentation>
<startEvent id="startevent2" name="Start"></startEvent>
<userTask id="usertask3" name="【初审】"></userTask>
<sequenceFlow id="flow5" sourceRef="startevent2" targetRef="usertask3"></sequenceFlow>
<userTask id="usertask4" name="【复核】"></userTask>
<sequenceFlow id="flow6" sourceRef="usertask3" targetRef="usertask4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${outcome=='同意'}]]></conditionExpression>
</sequenceFlow>
<endEvent id="endevent2" name="End"></endEvent>
<sequenceFlow id="flow7" sourceRef="usertask4" targetRef="endevent2">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${outcome=='同意'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow9" sourceRef="usertask4" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${outcome=='驳回'}]]></conditionExpression>
</sequenceFlow>
</subProcess>
<sequenceFlow id="flow2" sourceRef="usertask1" targetRef="subprocess1"></sequenceFlow>
<userTask id="usertask2" name="【经理审批】"></userTask>
<sequenceFlow id="flow3" sourceRef="subprocess1" targetRef="usertask2"></sequenceFlow>
<endEvent id="endevent1" name="End">