前面我们绘制了一个简单的流程图表,这个图表的本质,其实就是一个xml文件。我们大体熟悉下结构,不需要做太深入的研究;
我们右击helloWorld.bpmn文件,open with -> XML Editor ;
XML如下:
<?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节点:
这里我们看到的有三个节点,开始节点,结束节点,用户任务节点。这里还有两根连线,开始节点- > 用户任务节点 连线;
用户任务节点 -> 结束节点 连线;
对应到xml 是5个dom节点;
<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文件也越复杂,节点多,属性也多。
这个帖子只是让大家有个大体的熟悉,不需要深入研究;