camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.5k stars 481 forks source link

More meaningful error message on log #3047

Open Omcsesz opened 2 years ago

Omcsesz commented 2 years ago

Describe the bug

Hello, Team!

I have an apparently flawed .bpmn file which I want to import in Camunda Modeler (attached, change extension to bpmn), but the error messages show no hint on what is missing/broken in the file: probe.txt

The message is [C:\Users\machine\Desktop\probe.bpmn] Cannot read properties of undefined (reading 'x') [ warning ]

Steps to reproduce

  1. open Camunda Modeler
  2. open the attached file
  3. I get a few error messages, like: [C:\Users\machine\Desktop\probe.bpmn] Cannot read properties of undefined (reading 'x') [ warning ]

Expected behavior

The error message should contain more info on what is missing, like what is undefined, the properties of which can not be read.

Cf. BpmnImporter (https://github.com/camunda/camunda-modeler/issues/3047#issuecomment-1195478916).

Environment

Additional context

No response

pinussilvestrus commented 2 years ago

Thanks for reporting! Where did you export the diagram from? It seems like some DI is missing (as coordinates where to render the flow elements).

Omcsesz commented 2 years ago

Thanks for reporting! Where did you export the diagram from? It seems like some DI is missing (as coordinates where to render the flow elements).

I created it in one of my projects as a dummy file.

pinussilvestrus commented 2 years ago

I agree that the error message could be a bit more graceful in this case. Given the example diagram, the BpmnImporer is simply throwing with when a shape's bounds are missing.

It would be nice if the importer checks for missing bounds explicitly and throws accordingly.

<bpmndi:BPMNDiagram id="BPMNDiagram_1">
  <bpmndi:BPMNPlane bpmnElement="dummy-test-job"
                    id="BPMNPlane_1">
    <bpmndi:BPMNShape bpmnElement="StartEvent"
                      id="StartEvent_di"/>
    <bpmndi:BPMNShape bpmnElement="Step_1"
                      id="Step_1_di"/>
    <bpmndi:BPMNEdge bpmnElement="Flow_0"
                      id="Flow_0_di"/>
    <bpmndi:BPMNShape bpmnElement="Step_2"
                      id="Step_2_di"/>
    <bpmndi:BPMNEdge bpmnElement="Flow_1"
                      id="Flow_1_di"/>
    <bpmndi:BPMNShape bpmnElement="Step_3"
                      id="Step_3_di"/>
    <bpmndi:BPMNEdge bpmnElement="Flow_2"
                      id="Flow_2_di"/>
    <bpmndi:BPMNShape bpmnElement="EndEvent"
                      id="EndEvent_di"/>
    <bpmndi:BPMNEdge bpmnElement="Flow_3"
                      id="Flow_3_di"/>
  </bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
pinussilvestrus commented 2 years ago

I'm moving this to backlog, thanks for reporting 👍

pinussilvestrus commented 2 years ago

Thanks for reporting! Where did you export the diagram from? It seems like some DI is missing (as coordinates where to render the flow elements).

I created it in one of my projects as a dummy file.

Which tool are you using for modeling? Where did you export this diagram?

Omcsesz commented 2 years ago

Thanks for reporting! Where did you export the diagram from? It seems like some DI is missing (as coordinates where to render the flow elements).

I created it in one of my projects as a dummy file.

Which tool are you using for modeling? Where did you export this diagram?

I created it in Notepad++, as a minimum working example for testing my project which uses Camunda.

pinussilvestrus commented 2 years ago

I created it in Notepad++, as a minimum working example for testing my project which uses Camunda.

That's good to know. Manually creating BPMN files is pretty error-prone. Your attached diagram is clearly missing the DI bounds, therefore the Modeler is not able to properly render them. There is no autolayouting in place.

Omcsesz commented 2 years ago

I created it in Notepad++, as a minimum working example for testing my project which uses Camunda.

That's good to know. Manually creating BPMN files is pretty error-prone. Your attached diagram is clearly missing the DI bounds, therefore the Modeler is not able to properly render them. There is no autolayouting in place.

I know, I don't intend to create bpmn files manually, I just created this file as a minimal example to illustrate what I mean.