template.js 1.2 KB

12345678910111213141516171819202122
  1. let xml = `
  2. <bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
  3. <bpmn2:process id="process{str}" name="流程{str}">
  4. <bpmn2:startEvent id="StartEvent_01ydzqe" name="开始" activiti:initiator="applyUserId" />
  5. </bpmn2:process>
  6. <bpmndi:BPMNDiagram id="BPMNDiagram_1">
  7. <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process{str}">
  8. <bpmndi:BPMNShape id="StartEvent_01ydzqe_di" bpmnElement="StartEvent_01ydzqe">
  9. <dc:Bounds x="142" y="212" width="36" height="36" />
  10. <bpmndi:BPMNLabel>
  11. <dc:Bounds x="149" y="255" width="22" height="14" />
  12. </bpmndi:BPMNLabel>
  13. </bpmndi:BPMNShape>
  14. </bpmndi:BPMNPlane>
  15. </bpmndi:BPMNDiagram>
  16. </bpmn2:definitions>`;
  17. export default {
  18. initTemplate: function (str) {
  19. return xml.replace(/{str}/g, str)
  20. }
  21. };