Environment: mxcli v0.16.0 (official release) and Engalar fork commit 26f2866, Mendix 11.12.0 Beta, macOS arm64.
Mendix does not allow validation rules (inline not null/unique/range/regex, or a standalone VALIDATION RULE ... FOR ...) on attributes of a non-persistent entity — Studio Pro's compiler rejects this with CE0070: "Validations rules are not allowed on entity '', because it is not persistable." This is expected/correct Mendix behavior; the problem is that neither mxcli check (with or without --references) nor mxcli exec catches it — the script is accepted and the entity is created with the (invalid) validation attached, and the failure is only surfaced later by a real mx check/Studio Pro compile.
Steps to reproduce:
create module ZWLS44;
create non-persistent entity ZWLS44.NpEntity (
"Name": string(100) not null error 'Name is required'
);
mxcli check script.mdl -p app.mpr --references → passes clean.
mxcli exec script.mdl -p app.mpr → succeeds, entity created.
mx check app.mpr (or mxcli docker check) → [CE0070] Validations rules are not allowed on entity 'ZWLS44.NpEntity', because it is not persistable.
Expected: mxcli check (or at minimum exec) should flag this before it reaches a full compile, the same way it already flags other CE-shaped invalid constructs via its MDLxxx lint rules (e.g. MDL047 for = empty on associations, MDL048 for id = <string> XPath constraints — see mdl/executor/validate_microflow.go).
Actual: both mxcli check and exec are silent; only a real compile catches it. Reproduced identically on the official v0.16.0 release and on the Engalar fork (26f2866) — not fixed on either side.
Suggested fix location: domain-model statement validation (parallel to the existing validate_microflow.go MDL-rule family) — reject/warn on any validation construct (not null, unique, range, regex, or standalone VALIDATION RULE ... FOR ...) targeting a NON-PERSISTENT entity, with a fix hint pointing at making the entity persistent or moving the rule.
Environment: mxcli v0.16.0 (official release) and Engalar fork commit
26f2866, Mendix 11.12.0 Beta, macOS arm64.Mendix does not allow validation rules (inline
not null/unique/range/regex, or a standaloneVALIDATION RULE ... FOR ...) on attributes of a non-persistent entity — Studio Pro's compiler rejects this withCE0070: "Validations rules are not allowed on entity '', because it is not persistable." This is expected/correct Mendix behavior; the problem is that neithermxcli check(with or without--references) normxcli execcatches it — the script is accepted and the entity is created with the (invalid) validation attached, and the failure is only surfaced later by a realmx check/Studio Pro compile.Steps to reproduce:
mxcli check script.mdl -p app.mpr --references→ passes clean.mxcli exec script.mdl -p app.mpr→ succeeds, entity created.mx check app.mpr(ormxcli docker check) →[CE0070] Validations rules are not allowed on entity 'ZWLS44.NpEntity', because it is not persistable.Expected:
mxcli check(or at minimumexec) should flag this before it reaches a full compile, the same way it already flags other CE-shaped invalid constructs via itsMDLxxxlint rules (e.g.MDL047for= emptyon associations,MDL048forid = <string>XPath constraints — seemdl/executor/validate_microflow.go).Actual: both
mxcli checkandexecare silent; only a real compile catches it. Reproduced identically on the official v0.16.0 release and on the Engalar fork (26f2866) — not fixed on either side.Suggested fix location: domain-model statement validation (parallel to the existing
validate_microflow.goMDL-rule family) — reject/warn on any validation construct (not null,unique,range,regex, or standaloneVALIDATION RULE ... FOR ...) targeting aNON-PERSISTENTentity, with a fix hint pointing at making the entity persistent or moving the rule.