|
| 1 | +-- ============================================================================ |
| 2 | +-- Bug #351 (part): No-merge branch continuation |
| 3 | +-- ============================================================================ |
| 4 | +-- |
| 5 | +-- Symptom (before fix): |
| 6 | +-- When an `if/else` had ONE terminal branch (e.g. `return`) and ONE |
| 7 | +-- continuing branch, the builder did not need to insert an |
| 8 | +-- `ExclusiveMerge`. In that no-merge shape the parent flow that came |
| 9 | +-- after the IF was still being attached to the original split node |
| 10 | +-- instead of the tail of the continuing branch. The resulting graph |
| 11 | +-- re-described as if the post-IF activity belonged to the split, and |
| 12 | +-- `mx check` could fail with CE0117 because the next activity had |
| 13 | +-- ambiguous incoming flows. |
| 14 | +-- |
| 15 | +-- After fix: |
| 16 | +-- When the merge is skipped, the parent flow is attached to the tail |
| 17 | +-- of the continuing branch (not the split). Both branches with merges |
| 18 | +-- and no-merge shapes are now handled symmetrically. |
| 19 | +-- |
| 20 | +-- Usage: |
| 21 | +-- mxcli exec mdl-examples/bug-tests/351-no-merge-branch-continuation.mdl -p app.mpr |
| 22 | +-- mxcli -p app.mpr -c "describe microflow BugTest351.MF_NoMergeIfElse" |
| 23 | +-- `mx check` against the resulting MPR must report 0 errors and the |
| 24 | +-- describe → exec → describe cycle must converge to a fixpoint. |
| 25 | +-- ============================================================================ |
| 26 | + |
| 27 | +create module BugTest351; |
| 28 | + |
| 29 | +-- IF with one terminal branch (return) and one continuing branch (log). |
| 30 | +-- The post-IF `log info ... 'after branch'` and the final `return false;` |
| 31 | +-- must connect to the ELSE tail, not to the split. |
| 32 | +create microflow BugTest351.MF_NoMergeIfElse ( |
| 33 | + $Done: boolean |
| 34 | +) |
| 35 | +returns boolean as $Result |
| 36 | +begin |
| 37 | + if $Done then |
| 38 | + return true; |
| 39 | + else |
| 40 | + log info node 'BugTest351' 'else branch'; |
| 41 | + end if; |
| 42 | + |
| 43 | + log info node 'BugTest351' 'after branch'; |
| 44 | + return false; |
| 45 | +end; |
| 46 | +/ |
0 commit comments