Reorder lanes

I know that there is a feature request from 2019-04 that is asking for reordering lanes.

I do have that exact problem, therefore I am looking for the logic and part in the XML where Camunda is rendering the lanes in their order. From what I found in my XML the elements like the following seem to carry at least some geometry information:

<bpmndi:BPMNShape id="Lane_1m2g736_di" bpmnElement="Lane_1m2g736" isHorizontal="true">
    <dc:Bounds x="170" y="350" width="3850" height="350" />
    <bpmndi:BPMNLabel />
</bpmndi:BPMNShape>

But where in the file do I find the part from which Camunda is deriving the order of the lanes from?

Any help is highly appreciated!

But where in the file do I find the part from which Camunda is deriving the order of the lanes from?

You have found it already. There is no real order in the BPMN file, only the diagram information. You can compare the geometry of BPMNShape elements that refer to Lanes. You can then find the order by comparing the y attribute (for horizontal lanes) or the x attribute (for vertical lanes). However, you’d have to consider that lanes might be nested.

I’d guess in your example, another lane starts at y=700.

The functionality to reorder lanes would have to be implemented in the bpmn-js library. The forum post you linked already referred to the issue over at bpmn-js.