Exclusive Gateway Order of Evaluation

The documentation for the exclusive gateway states:

When the execution arrives at this gateway, all outgoing sequence flows are evaluated in the order in which they are defined


I presume by ‘order’, what is meant is the order in which the <sequenceFlow/> elements are declared within the XML document, from top to bottom. Is that a correct understanding?


I have run into instances where execution order seems to be somewhat arbitary, but the general rule seems to be that if you don’t have an explicit ordering set it evaluates in the order you created your wires. This can lead to some really, really funky behaviors that take forever to debug.

I tell anyone that works on Flowable models to always set an explicit execution order via the modeler GUI (click on the gateway in the modeler and it should say something like “Execution Order Not Set”). It’ll pop up a modal that lets you specify the order of your sequence flows. That way all my sequence flows get evaluated in the order I intend, not by some arbitrary definition.

Thanks Jeff,

I didn’t think to check the modeler. When I imported my process into the UI, the flow order editor showed the outgoing sequences in the order they appear in the XML. Then, after re-ordering the sequences and exporting, the only difference between the before and after documents is that the sequences were reordered in their location from top to bottom, which seems to confirm my question.

Thanks again,