Skip to content

mxcli check accepts seven constructs that Studio Pro rejects (CE0038/CE0068/CE0079/CE0711/CE0249/CE0111 + unvalidated icon glyphs) #893

Description

@Chendodelangen

Summary

Seven constructs that mxcli check (and exec) accept and write, and that Studio Pro then rejects with a consistency error. Same class as #832 (validation rules on non-persistent entities) and #833 (id = <String> XPath constraints), which is why they are bundled here rather than filed one by one.

Each of these cost a full build round: green check, green exec, and the defect only appears when a human opens the Errors pane.

Environment

  • mxcli v0.17.0, windows/amd64
  • Studio Pro 11.12.2, MPR format v2
  • CE codes observed in Studio Pro 11.12.2 while building an Odoo connector (19 entities, 77 microflows)

The seven

# MDL that passes check Studio Pro
1 DECLARE $X String; (no initial value) CE0038 — a Create Variable action requires a value
2 RETURN; inside LOOP ... END LOOP; / WHILE ... END WHILE; CE0068 — an end event is not allowed inside a loop
3 IF <cond> THEN ... END IF; as the FIRST statement of a WHILE body CE0079 / CE0773 — the false edge of the decision is written broken
4 ON ERROR { ... } without an explicit modifier CE0711 — the default is "rollback" and the handler flow returns to the main flow, which Mendix rejects. ON ERROR WITHOUT ROLLBACK is fine
5 An import-mapping element with KEY while object handling is Create CE0249 (hit 9x in one mapping set); KEY is only valid for find / find-or-create
6 DECLARE $X String = ''; followed by $X = CALL MICROFLOW ... (or rest call, COUNT, CREATE, import from mapping) CE0111 — two variables with the same name; the activity output does not reuse the declared variable
7 Icon: 'Atlas_Core.Atlas_Filled.<name-that-does-not-exist>' on a button, and the same for menu-item glyph references no error at all — renders as an empty icon. check --references does not validate glyph names, and the glyph set is not enumerable through mxcli, so there is no way to verify a name without Studio Pro

Reproduction for 1, 2, 3 and 6

This file passes mxcli check on v0.17.0 (✓ Syntax OK (4 statements)):

CREATE OR MODIFY MICROFLOW MyModule.ZZ_ProbeA ()
BEGIN
  DECLARE $X String;
  LOG INFO NODE 'x' 'y';
END;
/
CREATE OR MODIFY MICROFLOW MyModule.ZZ_ProbeB ()
BEGIN
  RETRIEVE $PartList FROM MyModule.Part;
  LOOP $Part IN $PartList
  BEGIN
    RETURN;
  END LOOP;
END;
/
CREATE OR MODIFY MICROFLOW MyModule.ZZ_ProbeC ()
BEGIN
  DECLARE $Continue Boolean = true;
  WHILE $Continue
  BEGIN
    IF 1 = 1 THEN
      $Continue = false;
    END IF;
  END WHILE;
END;
/
CREATE OR MODIFY MICROFLOW MyModule.ZZ_ProbeD ()
BEGIN
  DECLARE $Session String = '';
  $Session = CALL MICROFLOW MyModule.SomeMicroflow();
END;
/

Expected

check flags these before exec writes them, the way it already does for MDL043/MDL044 and for the constructs fixed in #832/#833. For case 7 an existence check on the glyph name (or a SHOW ICONS-style enumeration so a script can verify one) would be enough.

Why it matters

Without these checks the only reliable gate is Studio Pro's own consistency check. We ended up scripting that gate ourselves over the Studio Pro MCP server (ped_check_errors) to catch this class before handing work to a reviewer — useful, but it means every build round needs Studio Pro running.

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