Activiti学习四之了解Activiti bpmn图表对应的XML文件

前面我们绘制了的流程图的本质是一个xml文件,右击helloWorld.bpmn文件,open with -> XML Editor ;

 

 

XML如下:

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

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="myFirstProcess" name="My First process" isExecutable="true">

    <startEvent id="startevent1" name="Start">startEvent>

    <endEvent id="endevent1" name="End">endEvent>

    <userTask id="usertask1" name="HelloWorld" activiti:assignee="java1234_小锋">userTask>

    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1">sequenceFlow>

    <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1">sequenceFlow>

  process>

  <bpmndi:BPMNDiagram id="BPMNDiagram_myFirstProcess">

    <bpmndi:BPMNPlane bpmnElement="myFirstProcess" id="BPMNPlane_myFirstProcess">

      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">

        <omgdc:Bounds height="35.0" width="35.0" x="200.0" y="40.0">omgdc:Bounds>

      bpmndi:BPMNShape>

      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">

        <omgdc:Bounds height="35.0" width="35.0" x="200.0" y="200.0">omgdc:Bounds>

      bpmndi:BPMNShape>

      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">

        <omgdc:Bounds height="55.0" width="105.0" x="165.0" y="110.0">omgdc:Bounds>

      bpmndi:BPMNShape>

      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">

        <omgdi:waypoint x="217.0" y="75.0">omgdi:waypoint>

        <omgdi:waypoint x="217.0" y="110.0">omgdi:waypoint>

      bpmndi:BPMNEdge>

      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">

        <omgdi:waypoint x="217.0" y="165.0">omgdi:waypoint>

        <omgdi:waypoint x="217.0" y="200.0">omgdi:waypoint>

      bpmndi:BPMNEdge>

    bpmndi:BPMNPlane>

  bpmndi:BPMNDiagram>

definitions>

 

这里definitions是一个总的节点;下面process是流程节点,bpmndi:BPMNDiagram是流程图表定义节点;

bpmndi:BPMNDiagram这个节点里面就不用看了。是定义图标的位置,结构的。

我们重点看下process节点:

Activiti学习四之了解Activiti bpmn图表对应的XML文件_第1张图片

 

这里我们看到的有三个节点,开始节点,结束节点,用户任务节点。这里还有两根连线,开始节点- > 用户任务节点 连线;

用户任务节点 -> 结束节点 连线;

 

对应到xml 是5个dom节点;

1

2

3

4

5

<startEvent id="startevent1" name="Start">startEvent>

<endEvent id="endevent1" name="End">endEvent>

<userTask id="usertask1" name="HelloWorld" activiti:assignee="java1234_小锋">userTask>

<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1">sequenceFlow>

<sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1">sequenceFlow>

这里startEvent对应开始节点; endEvent对应结束节点; 

userTask对应用户任务节点; sequenceFlow对应用户任务节点,sourceRef targetRef 属性对应从哪里连接到哪里去。

流程越复杂,生成的对应XML文件也越复杂,节点多,属性也多。

 

你可能感兴趣的:(activity工作流)