Element definitions not in the right order when exported to XML

When a diagram is exported into XML some definitions are not in the right order compared to the bpmn schema.

As per BPMN schema (see below) the “dataOutput” is supposed to be defined before the “outputSet”. In the exported file this is not true.

Here are both files, the original and the one that the online bpmn.io editor exported when using “Download BPMN diagram” button. The problematic part can be seen in the StartEvent element with id=“ID_StartEvent”.
diagram_original.bpmn (30.5 KB)
diagram_exported.bpmn (29.9 KB)

Good finding. I added an issue for this:

May I use your diagram as an integration test as part of our test suite?

Yes, feel free to use our diagram.

I also noticed some strange behaviours in the case of timerEventDefinitions (from the same diagram).



Bpmn.io export:


Notice that the actual body of the element gets omitted.

The type tExpression does not have any body property defined. Yaoqiang would need to export it as tFormalExpression (which has a body defined):

 <timerEventDefinition id="ID_UserTaskTimeout3">
    <timeCycle xsi:type="tFormalExpression" id="ID_UserTaskTimeoutCycle"><![CDATA[1w]]></timeCycle>

I added a test case verifying we correctly handle that.

Thanks again for your feedback. It is highly appreciated and helps us making bpmn-js even better!

Ou, I see. Thanks and keep up the good work!