提交 | 用户 | 时间
|
722af2
|
1 |
export default (key, name, type) => { |
X |
2 |
if (!type) type = "camunda"; |
|
3 |
const TYPE_TARGET = { |
|
4 |
activiti: "http://activiti.org/bpmn", |
|
5 |
camunda: "http://bpmn.io/schema/bpmn", |
|
6 |
flowable: "http://flowable.org/bpmn" |
|
7 |
}; |
|
8 |
return ` |
|
9 |
<?xml version="1.0" encoding="UTF-8"?> |
|
10 |
<bpmn2:definitions |
|
11 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
12 |
xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" |
|
13 |
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" |
|
14 |
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" |
|
15 |
xmlns:di="http://www.omg.org/spec/DD/20100524/DI" |
|
16 |
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" |
|
17 |
id="diagram_${key}" |
|
18 |
targetNamespace="${TYPE_TARGET[type]}"> |
|
19 |
<bpmn2:process id="${key}" name="${name}" isExecutable="true"> |
|
20 |
</bpmn2:process> |
|
21 |
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> |
|
22 |
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}"> |
|
23 |
</bpmndi:BPMNPlane> |
|
24 |
</bpmndi:BPMNDiagram> |
|
25 |
</bpmn2:definitions> |
|
26 |
`; |
|
27 |
}; |