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

Splitting gateway is not modeled in a "new column" #77

Open till-stadtler opened 1 month ago

till-stadtler commented 1 month ago

Describe the Bug

While example 4 in PR #56 does work, if the task behind the first splitting gateway is removed, the placement of the second gateway fails. image

Steps to Reproduce

  1. Navigate to https://bpmn-io.github.io/bpmn-auto-layout/
  2. Model two splitting gateway with the first having an outgoing sequence flow directly ending in an end event (or just one element, not two)

Expected Behavior

I expect the second splitting gateway to be placed in a "new column".

Environment

https://bpmn-io.github.io/bpmn-auto-layout/

abdul99ahad commented 1 month ago

Is this issue related to https://github.com/bpmn-io/bpmn-auto-layout/issues/80?

For clarity, what I understood is gateways should always have a separate column?

till-stadtler commented 1 month ago

It is somewhat related.

Just a reminder: the layout code should not differentiate between gateways and other elements by checking the type. What to do with an element depends on the number of incoming and outgoing sequence flows. Most elements can splitting or joining or both. I just used gateways in this example, because it is the most common use case.

The necessary steps to place a splitting gateway:

The steps are similar for a merging gateway. For this you need to wait for "simple", "splitting",... to try to have all incoming elements placed. Then find the best position for the merging gateway. The 4th quadrant should be empty again, so the incoming sequence flows do not mess up existing elements (#80).