Skip to content

docs(examples): a jumps-and-merges flow for the layout examples - #1157

Merged
ako merged 1 commit into
mainfrom
feature/1154-jumps-merges-example
Sep 22, 2026
Merged

ako merged 1 commit into
mainfrom
feature/1154-jumps-merges-example

Conversation

@ako

@ako ako commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

What

Adds Pattern 6 — CxLayout.CX_SYNC_FactoryTelemetry to mdl-examples/doctype-tests/02c-complex-layout-examples.mdl. One flow, 37 elements, 4 merges, 11 joins. No code changes.

The file's five existing flows predate named merge / join, so nothing in it exercises the graphs a nested if cannot spell — which is exactly the part of the layout algorithm with no example coverage when that algorithm changes.

Pattern 6 covers all of them in one realistic flow:

Shape How it appears
Backward jump the java-action handler does join attempt, where merge attempt sits above the call — the retry edge runs right-to-left
Error → main flow a handler that gives up does join degraded; the main flow reaches that same merge when the response is empty
Crossed branches the inner split's FALSE arm and the outer split's FALSE arm both land on review
Fall-through handler the last handler ends without return / join, merging back on its own
Funnel three independent paths end at finish

Testing

  • mxcli check … --references against a Mendix 11.14.0 MPR v2 app: passes.
  • make check-mdl: passes, 02c included.
  • exec then re-exec: Created then Unchanged — idempotent.
  • Measured against fix: lay out microflows written without @position so they can be read #1155 (the layout PR) on that app: 2995 × 540 vs 4790 × 350 on current main, same 37 elements, flow identical apart from geometry.

Two things mxcli check caught in the first draft, both kept as-is in the final flow: an activity always creates its own output variable (declaring $RawResponse first is CE0111), and publish is a reserved word, so the merge label is emit.

For the reviewer

This example is also a repro for two gaps left in #923, written up with evidence in #923 (comment). Both reproduce on the pre-#1155 build, so they are pre-existing and unrelated to the layout work:

  1. A one-inbound merge that exec writes and the next exec deletes — describe says so itself ("re-executing this MDL DELETES it"), and the warning is gone after the round trip. Reduced to a 25-line repro in that comment.
  2. This flow goes from 0 describe warnings to 2 after a single describe → exec, the second being "This description is NOT equivalent to the microflow and must not be re-executed over it". Top-level merge sections get pulled inside the branch that joins them and one merge is dropped.

So: do not maintain this flow through describe → exec. It is the one flow in the file where that round trip is lossy, which is a property of the graph shape, not of this PR.

No issue was filed first (CONTRIBUTING.md step 1) — this came out of testing #1155 by hand. Happy to open one retrospectively if you'd prefer the trail.

🤖 Generated with Claude Code

02c's five flows predate named `merge` / `join`, so nothing in the file
exercises a backward jump, an error handler rejoining the main flow, or
crossed branches — the shapes a nested IF cannot spell, and the ones with
no coverage when the layout algorithm changes.

Pattern 6 (CX_SYNC_FactoryTelemetry) covers all of them in one flow:
37 elements, 4 merges, 11 joins — a retry whose handler jumps BACKWARD to
a merge above the call, three error handlers joining forward, an inner and
an outer split whose FALSE arms land on the same merge, a fall-through
handler, and a funnel where three paths end.

Measured on a Mendix 11.14.0 app: #1155 lays it out at
2995x540 against 4790x350 on current main — same 37 elements, flow
identical apart from geometry.

It is also a repro for two gaps left in #923, both of which reproduce on
the pre-#1155 build: a one-inbound merge that `exec` writes and the next
`exec` deletes, and a flow that goes from describing faithfully (0
warnings) to "must not be re-executed" (2 warnings) after a single
describe -> exec. Evidence in #923.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ako
ako merged commit 43a29ce into main Sep 22, 2026
15 checks passed
@ako
ako deleted the feature/1154-jumps-merges-example branch September 23, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant