valb3r / flowable-bpmn-intellij-plugin

Flowable, Activiti, Camunda BPMN engines process editor plugin for IntelliJ. Pure Kotlin (and some Java)
https://plugins.jetbrains.com/plugin/14318-flowable-bpmn-visualizer
MIT License
157 stars 31 forks source link

activiti7 reported an error when saving the process generated using Activiti BPMN visualizer #305

Closed XiaoyuZhann closed 2 years ago

XiaoyuZhann commented 2 years ago

Describe the bug activiti7 reported an error when saving the process generated using Activiti BPMN visualizer

To Reproduce Steps to reproduce the behavior:

  1. Create process file
  2. Edit process file
  3. Restart java program
  4. See error

Log

`2022-01-04 14:10:04.973 ERROR 5124 --- [ Test worker] o.a.e.impl.interceptor.CommandContext : Error while closing command context

org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 'documentation' 开头的无效内容。应以 '{"http://www.omg.org/spec/BPMN/20100524/MODEL":flowElement, "http://www.omg.org/spec/BPMN/20100524/MODEL":artifact, "http://www.omg.org/spec/BPMN/20100524/MODEL":resourceRole, "http://www.omg.org/spec/BPMN/20100524/MODEL":correlationSubscription, "http://www.omg.org/spec/BPMN/20100524/MODEL":supports}' 之一开头。 at org.activiti.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:280) ~[activiti-bpmn-converter-7.1.0.M4.jar:na] at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:148) ~[activiti-engine-7.1.0.M4.jar:na] at org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilder.createBpmnParseFromResource(ParsedDeploymentBuilder.java:96) ~[activiti-engine-7.1.0.M4.jar:na]`

BPMN definition

<?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/processdef">
  <process id="test" name="测试流程" isExecutable="true">
    <startEvent id="sid-506d6491-8a9c-41a6-a421-c0a3e5e7fa86" name="任务开始">
      <documentation>测试</documentation>
    </startEvent>
    <endEvent id="sid-384c83fe-1c63-4b12-9826-5076cf44d4f5" name="任务结束">
      <documentation>测试</documentation>
    </endEvent>
    <userTask id="sid-038067ce-e62e-4ef7-9170-5c2a2b8fa96c" name="审核">
      <documentation>测试</documentation>
    </userTask>
    <userTask id="sid-e7a44726-526f-44b3-871d-a80d7e8d4b14" name="申请任务">
      <documentation>测试</documentation>
    </userTask>
    <sequenceFlow id="sid-255e893a-20e2-449c-a2f7-40509df9ef57" sourceRef="sid-506d6491-8a9c-41a6-a421-c0a3e5e7fa86" targetRef="sid-e7a44726-526f-44b3-871d-a80d7e8d4b14"/>
    <sequenceFlow id="sid-59cb0a8c-9317-49f3-b045-b06d58f69f0c" sourceRef="sid-e7a44726-526f-44b3-871d-a80d7e8d4b14" targetRef="sid-038067ce-e62e-4ef7-9170-5c2a2b8fa96c"/>
    <sequenceFlow id="sid-acaf9c01-8e2c-4b92-993e-4e2919b96649" sourceRef="sid-038067ce-e62e-4ef7-9170-5c2a2b8fa96c" targetRef="sid-384c83fe-1c63-4b12-9826-5076cf44d4f5"/>
    <documentation>测试</documentation>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_test">
    <bpmndi:BPMNPlane bpmnElement="test" id="BPMNPlane_test">
      <bpmndi:BPMNShape id="shape-bd40de58-1386-425c-918e-0a07707d30a6" bpmnElement="sid-506d6491-8a9c-41a6-a421-c0a3e5e7fa86">
        <omgdc:Bounds x="-619.9216" y="-460.31158" width="30.0" height="30.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="shape-9ae66cca-4908-45d6-a1ff-e41d3d8005d7" bpmnElement="sid-384c83fe-1c63-4b12-9826-5076cf44d4f5">
        <omgdc:Bounds x="-605.1015" y="-159.60776" width="30.0" height="30.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="shape-9306a0c2-3d63-43cd-99fc-717be1080b79" bpmnElement="sid-038067ce-e62e-4ef7-9170-5c2a2b8fa96c">
        <omgdc:Bounds x="-646.4152" y="-281.65692" width="100.0" height="80.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="shape-e65b41a3-e775-4787-b707-c9327e29de8b" bpmnElement="sid-e7a44726-526f-44b3-871d-a80d7e8d4b14">
        <omgdc:Bounds x="-654.9216" y="-395.3053" width="100.0" height="80.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="edge-ba2a38dd-d2c2-4a5c-928e-d0ebb9505fa2" bpmnElement="sid-255e893a-20e2-449c-a2f7-40509df9ef57">
        <omgdi:waypoint x="-597.4216" y="-430.31158"/>
        <omgdi:waypoint x="-604.9216" y="-395.3053"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="edge-ba002fce-1ef9-432c-af1b-aad5efc7cf13" bpmnElement="sid-59cb0a8c-9317-49f3-b045-b06d58f69f0c">
        <omgdi:waypoint x="-604.9216" y="-315.3053"/>
        <omgdi:waypoint x="-596.4152" y="-281.65692"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="edge-0eec3bc4-ccc3-4f24-b584-7204e3e8093e" bpmnElement="sid-acaf9c01-8e2c-4b92-993e-4e2919b96649">
        <omgdi:waypoint x="-596.4152" y="-201.65692"/>
        <omgdi:waypoint x="-597.6015" y="-159.60777"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

IntelliJ version (please complete the following information):

Additional context Add any other context about the problem here.

valb3r commented 2 years ago

@XiaoyuZhann Thanks for the feedback it is a known issue - https://github.com/valb3r/flowable-bpmn-intellij-plugin/issues/176 It arises because <documentation> tag of the <process> must be at the beginning (but it is not mandated by underlying XSD supplied by Activiti): image I'll re-prioritize #176 accordingly

valb3r commented 2 years ago

@XiaoyuZhann Fix will be available in 0.4.9.3 plugin version