|
| 1 | +-- ============================================================================ |
| 2 | +-- Bug #326: Describer paired splits with downstream merge instead of nearest |
| 3 | +-- ============================================================================ |
| 4 | +-- |
| 5 | +-- Symptom (before fix): |
| 6 | +-- When a microflow had two sequential `if ... end if;` blocks, the |
| 7 | +-- describer could pair the FIRST split with the SECOND merge, nesting |
| 8 | +-- the continuation between the two ifs (and even the second if) inside |
| 9 | +-- the first if's body. A describe → exec → describe cycle then mutated |
| 10 | +-- the structure even though the original graph was valid: |
| 11 | +-- -- before fix, after first describe: |
| 12 | +-- if $Logo != empty then |
| 13 | +-- log info node 'App' 'logo'; |
| 14 | +-- log info node 'App' 'after logo'; -- wrong: was outside first if |
| 15 | +-- if $Cover != empty then -- wrong: was sibling, not nested |
| 16 | +-- log info node 'App' 'cover'; |
| 17 | +-- end if; |
| 18 | +-- end if; |
| 19 | +-- |
| 20 | +-- Root cause: |
| 21 | +-- Split/merge pairing picked any common downstream merge reachable from |
| 22 | +-- both branches, not the nearest one. Error-handler flows were included |
| 23 | +-- in the search, biasing it further. |
| 24 | +-- |
| 25 | +-- After fix: |
| 26 | +-- `findMergeForSplit` now uses shortest-path distances per branch and |
| 27 | +-- selects the nearest common merge, ignoring error-handler flows for |
| 28 | +-- structural pairing. |
| 29 | +-- |
| 30 | +-- Usage: |
| 31 | +-- mxcli exec mdl-examples/bug-tests/326-describer-pair-split-with-nearest-merge.mdl -p app.mpr |
| 32 | +-- mxcli -p app.mpr -c "describe microflow BugTest326.MF_SequentialIfs" |
| 33 | +-- The describe output must keep the two `if ... end if;` blocks as |
| 34 | +-- siblings (with the `log` between them at top level), and the |
| 35 | +-- describe → exec → describe cycle must be a fixpoint. |
| 36 | +-- ============================================================================ |
| 37 | + |
| 38 | +create module BugTest326; |
| 39 | + |
| 40 | +create microflow BugTest326.MF_SequentialIfs ( |
| 41 | + $Logo: string, |
| 42 | + $Cover: string |
| 43 | +) |
| 44 | +begin |
| 45 | + if $Logo != empty then |
| 46 | + log info node 'BugTest326' 'logo'; |
| 47 | + end if; |
| 48 | + |
| 49 | + log info node 'BugTest326' 'after logo'; |
| 50 | + |
| 51 | + if $Cover != empty then |
| 52 | + log info node 'BugTest326' 'cover'; |
| 53 | + end if; |
| 54 | +end; |
| 55 | +/ |
0 commit comments