defaultEmpty.js 896 B

123456789101112131415161718192021222324
  1. export default (key, name, type) => {
  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 `<?xml version="1.0" encoding="UTF-8"?>
  9. <bpmn2:definitions
  10. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11. xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
  12. xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  13. xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
  14. xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
  15. id="diagram_${key}"
  16. targetNamespace="${TYPE_TARGET[type]}">
  17. <bpmn2:process id="${key}" name="${name}" isExecutable="true">
  18. </bpmn2:process>
  19. <bpmndi:BPMNDiagram id="BPMNDiagram_1">
  20. <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}">
  21. </bpmndi:BPMNPlane>
  22. </bpmndi:BPMNDiagram>
  23. </bpmn2:definitions>`;
  24. };