Skip to content

Sync ako/mxcli: workflows written below Mendix 11.3 load and pass mx check - #1666

Merged
ako merged 4 commits into
mendixlabs:mainfrom
ako:main
Oct 28, 2026
Merged

ako merged 4 commits into
mendixlabs:mainfrom
ako:main

Conversation

@ako

@ako ako commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Syncs ako/mxcli:main into upstream: 2 commits from fork PR ako#1757.

Workflows written below Mendix 11.3 load and pass mx check

mxcli wrote every workflow in the Mendix 11.3 shape: the main flow's start and closing end stored as activities, and layout properties on every activity. mxcli check and exec passed, but below 11.3:

Mendix Symptom
10.24, 11.0 The project no longer loads: TypeCacheUnknownTypeException … Workflows$StartWorkflowActivity. The type is introduced in 11.1.0.
11.1, 11.2 CE6671 and CE6689. These versions have the type but keep the main flow's start and end implicit. 11.3 is the first to store them.
below 11.1 Every activity carried RelativeMiddlePoint/Size, which Workflows$WorkflowActivity declares only from 11.1.0. That includes an activity inserted by alter workflow … insert.

Fix

  • The encoder writes the shape the project's version stores.
    • Below 11.3, it drops the main flow's start and closing end. The header's annotation becomes the workflow's own note. A branch's end workflow stays.
    • Below 11.1, it drops the activity geometry in create, create-or-modify and the activity alter workflow … insert adds.
  • alter workflow … set (Annotation: …) writes the workflow's own note when there is no start activity to hold it.
  • The CREATE OR MODIFY guard counted branch ends as "all stored Ends − 1". Below 11.3 that silently dropped a branch's end workflow on a rewrite. It now subtracts the main End only when one is stored.
  • Property-set defaults: 10.24's mx convert adds UsertaskOnStateChangeEvent and WorkflowOnStateChangeEvent to every workflow. That was measured on 10.24 and 11.0 and is now in the defaults table.

Why CI missed it

  • 24-workflow-examples.mdl is gated 11.0+ as a whole file, so the nightly 10.24 leg never wrote a workflow.
  • The matrix's lowest 11.x, 11.6.8, is past both version boundaries.
  • The new 24b-workflow-mendix10-examples.mdl is gated 10.0+. On its first run it found the guard and property-set gaps above.

Verified

  • Unit tests: written first, red then green. They cover the shape per version (with 11.3, 11.14 and unread-version controls), the geometry (with an 11.1 control), the inserted activity, the note without a start, and the guard.

  • Real mx check of the bug-test script on fresh apps: blank app, then the fixed build, then the fixed build with both version predicates stubbed true:

    Mendix blank fixed stubbed
    10.24.24 0 0 TypeCacheUnknownTypeException
    11.0.0 0 0 TypeCacheUnknownTypeException
    11.1.0 0 0 CE6671 + CE6689
    11.3.0 (control) 0 0 0
  • Round trip on 10.24: executing the describe workflow output reports "Unchanged workflow" and leaves no unit bytes changed.

  • Local checks: make build, make test, make lint and make check-mdl pass, along with the findings, skill-index and wiki-page checks

claude and others added 4 commits October 28, 2026 07:08
…#1754)

mxcli wrote every workflow in the 11.3 shape, with a stored start and
closing end. That broke every workflow below 11.3, while `mxcli check` and
`exec` passed:

- 10.24 and 11.0: the project no longer loaded. mx check and Studio Pro
  throw TypeCacheUnknownTypeException for Workflows$StartWorkflowActivity,
  a type introduced in 11.1.0 (mendixmodelsdk 4.117.0).
- 11.1 and 11.2: CE6671 and CE6689. These versions have the type but keep
  the main flow's start and end implicit; 11.3 is the first to store them.
- Below 11.1, every activity carried RelativeMiddlePoint/Size, including
  one inserted by `alter workflow … insert`. Workflows$WorkflowActivity
  declares these from 11.1.0. The property-set pass does not look up
  supertype declarations, so it let them through.

The encoder now writes the shape the project's version stores. Below
11.3 it drops the main flow's start and closing end, and the start's note
becomes the workflow's own Annotation. A branch's `end workflow` stays.
Below 11.1 it drops the geometry, in create, modify and the mutator's
inserted activity. Below 11.3, `alter workflow … set (Annotation: …)`
writes the workflow's note, because there is no start activity to hold it.

Changing the stored shape broke a reader. The CREATE OR MODIFY guard
counted branch ends as "all stored Ends - 1", assuming the main flow's
End is always stored. Below 11.3 that counted one branch `end workflow`
as none, so a rewrite dropped it without a word. Measured on 10.24 with
the guard reverted: "Modified workflow". The guard now subtracts the
main flow's End only when it is stored.

Why CI missed it: 24-workflow-examples.mdl is gated 11.0+ as a whole
file, so the nightly 10.24 leg never wrote a workflow. The new
24b-workflow-mendix10-examples.mdl is gated 10.0+. On its first run it
found two more gaps: the guard above, and 10.24's property set. 10.24's
`mx convert` adds UsertaskOnStateChangeEvent and
WorkflowOnStateChangeEvent ({"v":null}) to every workflow. That
measurement, from a 10.24 + 11.0 record, is folded into the defaults
table with propdefaults.

Verified with mdl-examples/bug-tests/1754-workflow-below-mendix-11-3.mdl
on fresh 10.24.24, 11.0.0, 11.1.0 and 11.3.0 apps. The fixed binary
matches the blank app: 0 errors on every version. With both version
predicates stubbed true, it reproduces the report: TypeCacheUnknownType
on 10.24 and 11.0, CE6671 and CE6689 on 11.1, and clean on 11.3, the
control. In the doctype gate, 24b passes on 10.24, 11.0, 11.1 and 11.13,
and 24 passes on 10.24 and 11.13. On 11.0 and 11.1, 24 fails exactly as
it does on main: event-handler types, System.WorkflowGroup and the user
task's property set. Those are unrelated gaps, and both versions are
outside the nightly matrix. Describe and re-exec on 10.24 is
"Unchanged", with no unit bytes changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82sUVQEB3K5W5vh85wM
The #1754 note on where the header annotation is stored took the skill's
body to 701 lines, which TestLargeSkillsWereSplit refuses. Same content,
one line shorter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82sUVQEB3K5W5vh85wM
fix: workflows written below Mendix 11.3 do not load or fail mx check
@ako
ako merged commit 79cec01 into mendixlabs:main Oct 28, 2026
15 checks passed
Ricovl pushed a commit to Ricovl/mxcli that referenced this pull request Oct 28, 2026
…-unrelated-xpath

fix: rename attribute rewrites unrelated XPath constraints and drops their line breaks (ako#1506)
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.

2 participants