bpmn-io / bpmn-auto-layout

Layout BPMN diagrams, generating missing DI information.
https://bpmn-io.github.io/bpmn-auto-layout/
52 stars 41 forks source link

TypeError: Cannot read properties of undefined (reading 'flowElements') #46

Closed till-stadtler closed 2 months ago

till-stadtler commented 3 months ago

Describe the Bug

As part of the BPMN co-pilot prototype testing, the AI model returned a valid BPMN file with no process description.

The auto-layouter failed:

Chatbot.js:95 xml 
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
</bpmn:definitions>

Chatbot.js:112 error TypeError: Cannot read properties of undefined (reading 'flowElements')
    at Layouter.createGridLayout (index.js:711:31)
    at Layouter.handlePlane (index.js:700:25)
    at Layouter.layoutProcess (index.js:694:10)
    at async eval (Chatbot.js:102:13)

Steps to Reproduce

  1. call the auto-layouter with a valid BPMN file but missing process description

Expected Behavior

I expect the auto-layouter not to fail, and simply return an empty canvas.

Environment