1 <?xml version="1.0" encoding="UTF-8"?> 2 <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 4 xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" 5 xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" 6 typeLanguage="http://www.w3.org/2001/XMLSchema" exPRessionLanguage="http://www.w3.org/1999/XPath" 7 targetNamespace="http://www.activiti.org/test"> 8 9 <!-- 10 BPMN 2.0根節點是definitions節點。 這個元素中,可以定義多個流程定義11 (不過我們建議每個文件只包含一個流程定義, 可以簡化開發過程中的維護難度)。12 一個空的流程定義看起來像下面這樣。13 注意,definitions元素 最少也要包含xmlns 和 targetNamespace的聲明。14 targetNamespace可以是任意值,它用來對流程實例進行分類。15 -->16 17 <!-- 18 process元素有兩個屬性:19 id:這個屬性是必須的, 它對應著Activiti ProcessDefinition對象的key屬性。20 ‘id可以用來啟動流程定義的流程實例, 通過RuntimeService的startProcessInstanceByKey方法。 21 實際中一般都使用這種方式啟動流程。22 name:這個屬性是可選的, 對應ProcessDefinition的name屬性。 引擎自己不會使用這個屬性,23 它可以用來在流程圖上顯示便于查看的名稱。24 -->25 26 <process id="myProcess" name="My process" isExecutable="true">27 28 <!-- startEvent 開始事件, 是我們流程的入口 -->29 <startEvent id="startevent1" name="Start"></startEvent>30 31 <!-- userTask 用戶任務事件 , 是流程中與操作者相關的任務聲明。 -->32 <userTask id="usertask1" name="User Task"></userTask>33 34 <!-- endEvent 結束事件, 當流程達到結束事件時,整個流程就會結束 -->35 <endEvent id="endevent1" name="End"></endEvent>36 37 <!-- sequenceFlow 連線, 這些元素都使用連線連接。 這些連線擁有source 和 target屬性, 定義了連線的方向。 -->38 <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>39 <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>40 </process>41 <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">42 43 <!-- 44 以下是定義了一些流程事件的坐標45 -->46 47 <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">48 <bpmndi:BPMNShape bpmnElement="startevent1"49 id="BPMNShape_startevent1">50 <omgdc:Bounds height="35.0" width="35.0" x="60.0" y="130.0"></omgdc:Bounds>51 </bpmndi:BPMNShape>52 <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">53 <omgdc:Bounds height="55.0" width="105.0" x="190.0" y="119.0"></omgdc:Bounds>54 </bpmndi:BPMNShape>55 <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">56 <omgdc:Bounds height="35.0" width="35.0" x="390.0" y="130.0"></omgdc:Bounds>57 </bpmndi:BPMNShape>58 <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">59 <omgdi:waypoint x="95.0" y="147.0"></omgdi:waypoint>60 <omgdi:waypoint x="190.0" y="146.0"></omgdi:waypoint>61 </bpmndi:BPMNEdge>62 <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">63 <omgdi:waypoint x="295.0" y="146.0"></omgdi:waypoint>64 <omgdi:waypoint x="390.0" y="147.0"></omgdi:waypoint>65 </bpmndi:BPMNEdge>66 </bpmndi:BPMNPlane>67 </bpmndi:BPMNDiagram>68 </definitions>
新聞熱點
疑難解答