Skip to content

Commit 902bf38

Browse files
authored
learn(workflow, fixture-seeding): a jump has one fixed target; probed build errors; workflow seed reset (WF-1, WF-5) (#415)
Independent review: APPROVE. # Review #415 r2: WF-1 jump rule plus WF-5 workflow seed reset (skill text) Head ca30e29 (on top of origin/master 90a2d36). Delta against the r1 review (415.md, CHANGES). Read-only detached worktrees (head and origin/master), no GitHub comment. ## What I ran | Check | Result | |---|---| | `bin/render-routing.sh --check`, origin/master and head | both rc 0, outputs **byte-identical**: baseline 75225 of 80000, nine stage lines (P, 0 to 7) identical per role | | Routing class of the 3 touched skills | all `ondemand` in `bin/lib/skill-routing.tsv`, unchanged | | `bin/check-pr-discipline.sh origin/master` | clean, both CHANGELOG entries credited | ## r1 points | # | Asked | Status | |---|---|---| | 1 | Real table names in `fixture-seeding.md` and CHANGELOG, add the ended-task links, say they were read from an 11.15 database | **Fixed.** All five names match the r1 `information_schema` read; the `system$workflowendedusertask_assignees / _targetusers / _targetgroups` links are added; "There is no `usertask_targets` table" and "list the real names first on another version" are good additions. CHANGELOG carries the same names. | | 2 | `returns` row: both messages, cite #1533 | **Fixed.** "expecting BEGIN" (v0.26.0) and "expecting STRING_LITERAL" (v0.27.0, mendixlabs/mxcli#1533). | | 3 | CE1613 row: describe drops every mapping (#1531), syntax help shows the failing form (#1530); cite #1529 on CE0117 | **Fixed.** All three issue numbers present, the "don't copy that example" warning and "keep the `.mdl` as the source, don't round-trip through describe" fix are there. | | 4 | CHANGELOG/body: issue numbers instead of "no GitHub issue"; nine stage lines, not seven | **Fixed.** Both CHANGELOG and body name #1529, #1530, #1531, #1533; body says nine stage lines. | ## Nit (not blocking) `fixture-seeding.md`: one line runs to about 120 characters ("trusting this list on another version. Abort instances ...") where the rest of the file wraps near 100. Cosmetic. ## Verdict: APPROVE
1 parent c8d3ef3 commit 902bf38

4 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m
1919

2020
## Unreleased
2121

22+
- learn(workflow skills): **a Jump has one fixed target, so one failure handler for N steps is a child workflow, not a shared node; plus three probed workflow errors (CE0117 on a `System.Workflow` argument means map `$WorkflowInstance`, CE1613 means the called workflow's parameter must be `$WorkflowContext`, and `returns` goes before `exposed as workflow action`).** `workflow-structure-rules.md` §1 and `learned-workflow-patterns.md` §9. The §9 rows were probed on mxcli v0.26.0 / Mendix 11.15.0 with native `mx check`. The third row corrects the reading that a called microflow cannot return a value. Upstream issues: mendixlabs/mxcli#1529 (CE0117), #1530 (CE1613, and `syntax workflow call-workflow` shows the failing form), #1531 (describe drops every call workflow mapping), #1533 (`returns` parse messages). Source: a five-app lab project (Mendix 11.15, mxcli v0.26.0) — five-app lab report, WF-1
23+
- learn(fixture-seeding): **resetting workflow data: abort instances through the runtime (Workflow Commons admin or *Change workflow state*); if SQL is unavoidable, delete the link tables first (`system$workflow_currentactivity`, `system$workflow_workflowdefinition`, `system$workflowusertask_assignees`, `system$workflowusertask_targetusers`, `system$workflowusertask_targetgroups`, plus the `system$workflowendedusertask_*` equivalents; names read from a Mendix 11.15 database), and reset a context object only after its instances are gone.** A seed reset that deleted workflow rows by SQL failed on those links (WF-5). Text only, `ondemand` skill. — five-app lab report, WF-5
2224
- fix(e2e/helpers): **`navTo` throws `navigation item "<title>" not found` instead of clicking nothing.** A missing menu item was a silent no-op, so when the target page was also the persona's home page the landing guard stayed green and a broken-control journey (a control that must FAIL) passed. The parent group stays soft (an open flyout needs no click); the item itself must be found. The message names the active user and the visible menu items, so the reader can tell a renamed item (fix the journey) from a role that cannot open the page (fix the grants). Callers: journey steps fail with the message, design-audit rung 7 records a fault, full-app-walkthrough records a failed `nav` step (the walk stops only when the step is `fatal`), monkey's `land` swallows the error and still checks `.mx-page`, so monkey is unchanged. `tests/wave2/test-navto-missing-item.sh` (stub page, no browser) fails on master (absent item resolves) and passes here. Field report: a five-app lab project (Mendix 11.15, mxcli v0.26.0), TK-012 — MendixMau
2325
- learn(rest-between-mendix-apps): **new on-demand skill for two or more Mendix apps you build that read each other over REST (app-to-app, microservices).** The contract decisions to write down before the first script (pull vs push, versioned path, key + version rule, cursor paging, `since` with overlap, error shape incl. the runtime's 560, auth in the operation microflow as of mxcli v0.24 per BUG-152, fixed ports, one owner per fact), 17 publisher and consumer rules for honest "as of"/stale/"never read" states, and a six-rung cross-app test ladder with a per-change/slice/release cadence; a signal-stopped test run is BUG-157. The 26-row failure register behind it is `process/rest-between-mendix-apps-register-2026-10.md`. Routed ondemand for architect, mdl, test and review at stages 3–6. Field evidence: three demo apps, mxcli v0.24–v0.26, Mendix 11.15, 2026-10-07 to 2026-10-12, domain names generalised — MendixMau
2426
- fix(docs-numbering): **the pre-commit doc numbering check no longer fails every merge commit.** A merge stages all the other side's files, so the check examined docs the merge never touched and tripped on the existing "15-step" prose in `skills/source-triage.md:240` (plus two siblings that fail `--all`), which sent agents to `--no-verify`. During a merge it now examines only files that differ from both parents. The doc prose is left alone (an anecdote, not a drift). `tests/wave2/test-docs-numbering.sh` T11 fails on master's script. — agent report of `--no-verify` merges

‎skills/fixture-seeding.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,20 @@ the answer is "re-copy the Run Locally database", say that in the project's own
201201
"re-run the seed script", the seed script has to be idempotent, which most hand-written ones are
202202
not.
203203

204+
### Workflow data: abort through the runtime, link tables first if SQL
205+
206+
A seed reset that deletes workflow rows by SQL fails while the link tables still point at them.
207+
On Mendix 11.15 (names read from a database, not from docs) they are
208+
`system$workflow_currentactivity`, `system$workflow_workflowdefinition`,
209+
`system$workflowusertask_assignees`, `system$workflowusertask_targetusers` and
210+
`system$workflowusertask_targetgroups`. Finished tasks keep their own links, with rows:
211+
`system$workflowendedusertask_assignees`, `_targetusers`, `_targetgroups`. There is no
212+
`usertask_targets` table. List the real names first (`information_schema.tables`) rather than
213+
trusting this list on another version. Abort instances through the runtime (Workflow Commons admin, or a microflow
214+
with *Change workflow state*); if SQL is unavoidable (local database only), delete the link tables
215+
first. Reset a context object only after its instances are gone: a deleted context object makes an
216+
instance incompatible, and that cannot be resolved (Mendix docs, *Workflow versioning*).
217+
204218
## What seeding buys - set expectations
205219

206220
Journeys PASS / FAIL / INVALID on two public template apps, same set, empty vs seeded database:

‎skills/learned-workflow-patterns.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,9 @@ varying **only** the suspected cause — see [[sandbox-ab-tool-defect-probe]].
653653
| **CE0053 / MDL040** | `DECLARE $L List of Mod.Entity = empty;` | Use `$L = CREATE LIST OF Mod."Entity";` |
654654
| **CE0108** | A `RETRIEVE` inside an `IF` shadows the named return variable, leaving it out of scope on the `ELSE` path | Use early `RETURN empty;` on failure branches so only the success path reaches the named-return retrieve |
655655
| **MDL-WF04** | Standalone `ANNOTATION` in a workflow activity flow (produces an unloadable model) | Use a plain MDL comment |
656+
| **CE0117** at a *Call microflow* whose microflow takes a `System.Workflow` parameter | You passed a variable the workflow does not have (`Workflow = $Workflow`). `check --references` passes it. Only native `mx check` refuses it (mxcli v0.26.0, Mendix 11.15.0, probed 2026-10-15; upstream mendixlabs/mxcli#1529) | Map it to `$WorkflowInstance`: `call microflow M.ACT_X(Workflow = $WorkflowInstance, Ctx = $WorkflowContext)`, which builds clean (same probe). Don't look the instance up through `System.Workflow_ParentWorkflow` instead. That lookup has to guess when more than one child is in progress |
657+
| **CE1613** "The selected parameter '…' no longer exists" at a *Call workflow* | The called workflow's parameter is named something other than `$WorkflowContext` (`parameter $Task: …` with `(Task = …)`). `check --references` passes it. `describe workflow` drops every call workflow mapping, correct ones included (mendixlabs/mxcli#1531), and `mxcli syntax workflow call-workflow` still prints the failing form (`Request = $WorkflowContext`, v0.27.0; #1530), so do not copy that example (mxcli v0.26.0, probed 2026-10-15) | Every workflow that is called declares `parameter $WorkflowContext: …`, and the call maps `(WorkflowContext = …)`. Keep the `.mdl` file as the source; don't round-trip the call through `describe` |
658+
| parse error on a workflow call microflow: `mismatched input 'returns' expecting BEGIN` (v0.26.0) or `mismatched input 'returns' expecting STRING_LITERAL` (v0.27.0, mendixlabs/mxcli#1533) | `exposed as workflow action …` written before `returns …` | Write `returns Boolean as $Ok` first, then `folder` and `exposed as workflow action`. A called microflow *can* return a value: a Boolean gives the activity `true`/`false` outcomes and an enumeration one outcome per value plus empty (Mendix docs, *Call microflow*). "Exposed call microflows return nothing" is a wrong reading of this parse error (probed 2026-10-15) |
656659
| **MPR006** | Empty container — compiles, crashes at runtime | Give every container content, or drop it |
657660
| **MPR010** | Widgets not wrapped in a `LAYOUTGRID` | Wrap them |
658661
| Workflow stuck | No `complete_task` button for one of the task's outcomes | Add the missing outcome button |

‎skills/workflow-structure-rules.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,27 @@ Two failures this prevents, both invisible to `mxcli check`:
5555
The main flow is `Start → … → End`. New activities go after the start and before the end (or
5656
before a *Jump*, when the main flow ends on one).
5757

58+
**A *Jump to* has one fixed target. It cannot return to whichever step sent it there.** So "every
59+
failing step goes to one shared failure node, then retries the step that failed" is not a
60+
workflow you can draw: the retry needs a different target for each step, and there is no
61+
"return to caller". A five-app lab project (Mendix 11.15, mxcli v0.26.0) drew exactly that for
62+
seven calls. The Stage 3 count (§12) refused it, and the redesign cost a resolution round plus a
63+
resync of the blueprint and three BRDs. When one failure handler must serve N steps:
64+
65+
- put the step and its retry or attention loop in a **child workflow** that each step reaches
66+
through *Call workflow*. The child holds one handler, and its backward jumps stay inside the
67+
child, so every target is fixed;
68+
- the child ends **normally** and writes its result on its own context (an outcome attribute).
69+
The parent reads it in a decision after the call. A sub-workflow returns nothing, and if it
70+
*fails* or is aborted, the parent fails too (Mendix docs, *Call workflow*). Failure must
71+
therefore be data, never an error;
72+
- a jump in the parent aborts a running child (same page). Keep jumps in the parent to the
73+
points where no child is running.
74+
75+
The alternative, one copied tail per step, multiplied a 7-call parent to 21 calls and 43
76+
decisions in that project's count. Count the child design and the copied-tail design (§12)
77+
before you choose.
78+
5879
## 2. Boundary events — type decides the terminator
5980

6081
A boundary event hangs on one parent activity. Only these can carry one: *wait for

0 commit comments

Comments
 (0)