init.js 1.3 KB

123456789101112131415161718192021222324
  1. function randomStr() {
  2. return Math.random().toString(36).slice(-8)
  3. }
  4. export default function(papBusinessName) {
  5. return `<?xml version="1.0" encoding="UTF-8"?>
  6. <definitions xmlns="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:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:bioc="http://bpmn.io/schema/bpmn/biocolor/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" targetNamespace="http://www.flowable.org/processdef">
  7. <process id="process_${randomStr()}" name="${papBusinessName}">
  8. <startEvent id="startNode1" name="开始" />
  9. </process>
  10. <bpmndi:BPMNDiagram id="BPMNDiagram_flow">
  11. <bpmndi:BPMNPlane id="BPMNPlane_flow" bpmnElement="T-2d89e7a3-ba79-4abd-9f64-ea59621c258c">
  12. <bpmndi:BPMNShape id="BPMNShape_startNode1" bpmnElement="startNode1" bioc:stroke="">
  13. <omgdc:Bounds x="240" y="200" width="30" height="30" />
  14. <bpmndi:BPMNLabel>
  15. <omgdc:Bounds x="242" y="237" width="23" height="14" />
  16. </bpmndi:BPMNLabel>
  17. </bpmndi:BPMNShape>
  18. </bpmndi:BPMNPlane>
  19. </bpmndi:BPMNDiagram>
  20. </definitions>
  21. `
  22. }