Skip to content

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

Description

@MendixMau

Repo: mendixlabs/mxcli
Affects: v0.16.0 (current Latest release) — and, per prior testing, still unfixed on RnD 504aec67
Mendix: 11.13.0
Severity: Medium — model is loadable but carries a hard CE error; the failure is easy to misattribute to DECISION support being broken.


Summary

The workflow context variable is $WorkflowContext. In a CALL MICROFLOW … WITH (…) clause,
1b390dce normalizes the casing of the expression, so a lowercase $workflowContext is accepted.
DECISION expressions get no such normalization — they are stored verbatim, and Mendix then
rejects the unknown variable with CE0117.

This matters because the bundled write-workflows skill documents the lowercase spelling in its
DECISION example, so following the shipped docs produces a CE error.

Reproduction

Two workflows, identical except for the casing of the context variable.

-- E: lowercase, exactly as the bundled skill documents
CREATE WORKFLOW TFC."WF_ProbeE"
  PARAMETER $WorkflowContext: TFC."TFCStub"
BEGIN
  DECISION '$workflowContext/IsExclusive'
    OUTCOMES true -> { } false -> { };
END WORKFLOW;

-- F: correct casing (control)
CREATE WORKFLOW TFC."WF_ProbeF"
  PARAMETER $WorkflowContext: TFC."TFCStub"
BEGIN
  DECISION '$WorkflowContext/IsExclusive'
    OUTCOMES true -> { } false -> { };
END WORKFLOW;

Both pass mxcli check --references and both exec cleanly. Then mx check:

Workflow Stored expression (read from BSON) mx check
E lowercase $workflowContext/IsExclusive — verbatim, not normalized [error] [CE0117] "Error(s) in expression." at Decision 'Decision'
F correct case $WorkflowContext/IsExclusive 0 errors

Attribution is clean: with both present the project reports exactly 1 error; dropping E alone
returns it to 0 errors.

Expected

DECISION expressions should get the same context-variable case normalization that
CALL MICROFLOW … WITH already received in 1b390dce — or mxcli check should flag the unknown
variable before exec.

Documentation defect

write-workflows (bundled with v0.16.0) uses the lowercase form in the DECISION example:

decision '$workflowContext/Total > 1000'
  outcomes
    true  -> { call microflow Module.ACT_Escalate; }
    false -> { call microflow Module.ACT_AutoApprove; };

Worth fixing regardless of which way the code fix goes.

Note on a related, unverified case

Variant D in the companion report (CALL MICROFLOW … WITH (TFCStub = '$workflowContext'), i.e.
lowercase inside a WITH clause on v0.16.0) stored the expression verbatim as $workflowContext
and still passed mx check with 0 errors. Whether that binds correctly at runtime was not
tested — on Mendix 11.12.1 this exact class of defect was historically silent at check time and
wrong at runtime. Correct casing is the safe recommendation everywhere until that is verified.

Why this was previously misdiagnosed

An earlier local bug entry recorded "DECISION with enum comparison is broken in workflows" and the
design dropped decision gateways as a result. The actual cause was the lowercase w. Gateways work
fine on both binaries with $WorkflowContext.

Environment

  • mxcli v0.16.0 (2026-07-12T11:44:17Z)
  • Mendix Studio Pro 11.13.0 Beta; gated with that bundle's own mx
  • macOS 15 (Darwin 25.5.0), Apple silicon
  • Probe contained no CALL MICROFLOW, deliberately — the companion CALL MICROFLOW defect
    otherwise fires first and masks this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions