Skip to content

Fix: normalize $workflowContext in workflow DECISION expressions (CE0117) - #93

Merged
ako merged 1 commit into
mainfrom
claude/fix-845-workflow-decision-context-casing
Aug 6, 2026
Merged

Fix: normalize $workflowContext in workflow DECISION expressions (CE0117)#93
ako merged 1 commit into
mainfrom
claude/fix-845-workflow-decision-context-casing

Conversation

@ako

@ako ako commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes mendixlabs#845. A workflow DECISION whose expression uses the documented lowercase $workflowContext produced a project that would not build:

[error] [CE0117] "Error(s) in expression." at Decision 'Decision'

The context parameter is named WorkflowContext, and Mendix expressions are case-sensitive on 11.9+, so $workflowContext is an undefined variable.

Root cause

normalizeWorkflowContextExpr already existed and was unit-tested — it was simply never called from buildExclusiveSplit. Only autoBindCallMicroflow (the FINDINGS #39 fix) applied it.

That asymmetry is what disguised the bug: the same spelling works in a CALL MICROFLOW … WITH clause and fails in a DECISION, so a user reasonably concludes the casing is fine. mxcli check and mxcli exec both report success; only mx check catches it.

Changes

  • buildExclusiveSplit runs the authored expression through the existing normalizeWorkflowContextExpr.
  • buildWaitForTimer does the same. This is the third and last expression site in the workflow writer, and a delay may reference a date attribute on the workflow context — the identical defect. Fixing one and knowingly leaving its twin didn't seem defensible; both are covered by tests.
  • Documentation fix. The bundled write-workflows skill taught the broken lowercase form in its own DECISION example. That file is synced into every user project by mxcli init via cmd/mxcli/skills/, so following the shipped docs produced a project that would not build. Corrected both examples and added the casing rule to Platform rules.
  • Symptom table row appended to .claude/skills/fix-issue.md.

Validation

  • make test, make check-mdl (257 pass), make lint-go — all clean
  • Test written first and verified to fail with the reported symptom before the fix

Mendix validation — 11.13.0, mx check: the repro script went from 1 error (CE0117) → 0 errors. Repro: mdl-examples/bug-tests/845-workflow-decision-context-casing.mdl.

The same run independently confirmed mendixlabs#844 and mendixlabs#846 are already fixed on main (the stored BSON shows Workflows$CallMicroflowActivity and a correctly non-doubled parameter reference) — those two are release-lag, not code bugs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LUToAkUx54bNkNjsBpufRH


Generated by Claude Code

The workflow context parameter is stored as "WorkflowContext" and Mendix
expressions are case-sensitive on 11.9+, so a user-written
`$workflowContext` is an undefined variable. mx check reports:

    [error] [CE0117] "Error(s) in expression." at Decision 'Decision'

normalizeWorkflowContextExpr already existed and was unit-tested, but was
only applied in autoBindCallMicroflow (the FINDINGS #39 fix).
buildExclusiveSplit stored the authored expression verbatim. That the
identical spelling works in a CALL MICROFLOW ... WITH clause is what
disguised the bug — the user reasonably concludes the casing is fine.

Apply the same normalizer in buildExclusiveSplit, and in the sibling
buildWaitForTimer whose delay expression may reference a date attribute
on the workflow context — the third and last expression site in the
workflow writer, and subject to the identical failure.

Also fix the documentation that taught the broken form: the bundled
write-workflows skill used lowercase in its DECISION example, and is
synced into every user project by `mxcli init`, so following the shipped
docs produced a project that would not build.

Verified end to end on Mendix 11.13.0: the repro script went from
1 error (CE0117) to 0 errors under mx check.

Closes mendixlabs#845

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LUToAkUx54bNkNjsBpufRH
@ako
ako merged commit c68177e into main Aug 6, 2026
3 checks passed
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.

Workflow DECISION expressions are not case-normalized, so the documented $workflowContext yields CE0117

2 participants