Summary
A layout rule (flow-zigzag) that reports a sequence flow which reverses on itself and keeps bending instead of reaching its target directly. Decides purely on DI coordinates, scoped per BPMNPlane.
Motivation
Readers follow a flow fastest when it makes steady progress to its target. Agents / auto-layout often emit loop-backs that wrap and then stair-step home with redundant corners. The XML review looks clean and the connection is valid; only the drawn diagram shows the snake.
Proposed Solution
A monotone flow (never doubling back on either axis: a straight line, an L, a Z, or a staircase) is always fine, however many bends it has. A flow that reverses direction gets a small budget of bends for the wrap (maxWrapBends, default 3); beyond that it is reported. Self-loops are skipped (always a full wrap).
Includes a correctness requirement: the monotonicity check (isMonotonePath) must use the same axis tolerance as the orthogonality check. Otherwise a near-orthogonal rung (within flow-orthogonal's tolerance, e.g. ~4px drift over ~170px) is misread as a direction reversal, and a clean monotone staircase is falsely flagged. Fix: judge each segment by its dominant axis and ignore minor-axis drift.
Wire as error in plugin:@miragon/rules/all and non-blocking warn in both recommended-for-modeling and recommended-for-automation.
Acceptance Criteria
Summary
A layout rule (
flow-zigzag) that reports a sequence flow which reverses on itself and keeps bending instead of reaching its target directly. Decides purely on DI coordinates, scoped perBPMNPlane.Motivation
Readers follow a flow fastest when it makes steady progress to its target. Agents / auto-layout often emit loop-backs that wrap and then stair-step home with redundant corners. The XML review looks clean and the connection is valid; only the drawn diagram shows the snake.
Proposed Solution
A monotone flow (never doubling back on either axis: a straight line, an L, a Z, or a staircase) is always fine, however many bends it has. A flow that reverses direction gets a small budget of bends for the wrap (
maxWrapBends, default 3); beyond that it is reported. Self-loops are skipped (always a full wrap).Includes a correctness requirement: the monotonicity check (
isMonotonePath) must use the same axis tolerance as the orthogonality check. Otherwise a near-orthogonal rung (withinflow-orthogonal's tolerance, e.g. ~4px drift over ~170px) is misread as a direction reversal, and a clean monotone staircase is falsely flagged. Fix: judge each segment by its dominant axis and ignore minor-axis drift.Wire as
errorinplugin:@miragon/rules/alland non-blockingwarnin bothrecommended-for-modelingandrecommended-for-automation.Acceptance Criteria
flow-orthogonal)