|
| 1 | +-- Two statements `mxcli check` passed, `exec` wrote without complaint, and only |
| 2 | +-- mxbuild refused — one of them by refusing to LOAD the project at all. |
| 3 | +-- ako/CapTrackV3 FINDINGS §9 and §46. |
| 4 | +-- |
| 5 | +-- 1. AN UNASSIGNED CREATE (§9): |
| 6 | +-- |
| 7 | +-- CREATE Mod.Region ( Name = 'North' ) COMMIT; -- no `$Var =` |
| 8 | +-- mx check -> [CE6005] "The 'Entity' property is required." |
| 9 | +-- at Create object activity 'Create Region (Name)' |
| 10 | +-- |
| 11 | +-- The error names the wrong property. `Entity` IS stored. A field-level diff |
| 12 | +-- of the assigned and unassigned documents differs in ONE substantive field — |
| 13 | +-- `Action.VariableName`, "R" vs "" — everything else being identity (element |
| 14 | +-- IDs, flow pointers, StableId). A Mendix Create activity always names its |
| 15 | +-- output, and Studio Pro supplies the name itself when you drop one. Patching |
| 16 | +-- that single field took the project from 1 error to 0; restoring it took it |
| 17 | +-- back to 1. |
| 18 | +-- |
| 19 | +-- mxcli now supplies it too, on Studio Pro's `New<Entity>` convention. |
| 20 | +-- Supplied rather than refused, because nothing is guessed: the author said |
| 21 | +-- create this entity and did not ask for a handle, which is exactly what an |
| 22 | +-- auto-named output is. The generated name is NOT registered as |
| 23 | +-- referenceable, so a later `change $NewRegion` stays the error it is. |
| 24 | +-- |
| 25 | +-- 2. A TWO-PART SORT PATH (§46) — the severe one: |
| 26 | +-- |
| 27 | +-- RETRIEVE $Rows FROM Mod.Item SORT BY System.createdDate ASC; |
| 28 | +-- mxcli check -> passed |
| 29 | +-- mxcli exec -> succeeded, no complaint |
| 30 | +-- mx -> System.ArgumentNullException: Value cannot be null. |
| 31 | +-- at DomainModels.Refs.AttributeRef.set_AttributeId |
| 32 | +-- |
| 33 | +-- Not a CE code — an unhandled exception with a stack trace. The project is |
| 34 | +-- UNLOADABLE, so Studio Pro cannot open it either. The report attributed the |
| 35 | +-- exception to `exec`; it is `mx` READING what exec wrote. |
| 36 | +-- |
| 37 | +-- One guard caused it. The qualified branch validated `len(parts) >= 3`, so a |
| 38 | +-- two-part path fell through every check and was written verbatim as the |
| 39 | +-- sort's AttributeQualifiedName. `System.createdDate` reads as |
| 40 | +-- Module.Attribute, names no entity, and Mendix stores a null AttributeId. |
| 41 | +-- |
| 42 | +-- Refused rather than repaired: `Module.Attribute` has no reading that names |
| 43 | +-- an entity, and the two candidate repairs — a bare member of the retrieved |
| 44 | +-- entity, or a member of the module's like-named entity — mean different |
| 45 | +-- things, and only the author knows which. |
| 46 | +-- |
| 47 | +-- WHAT ACTUALLY WORKS FOR A SYSTEM MEMBER, measured on 11.14.0. This is narrower |
| 48 | +-- than the report suggests, and worth stating because the obvious reading is |
| 49 | +-- wrong: |
| 50 | +-- |
| 51 | +-- sort by <a real attribute> 0 errors |
| 52 | +-- sort by createdDate (entity STORES it) 0 errors <- the right spelling |
| 53 | +-- sort by createdDate (entity does not) CE1613 <- Mendix is right |
| 54 | +-- sort by CreatedDate (wrong case) CE1613 <- Mendix is right |
| 55 | +-- sort by System.createdDate UNLOADABLE <- the defect |
| 56 | +-- |
| 57 | +-- A system member is spelled BARE and works. An earlier reading of this — that |
| 58 | +-- mxcli could not sort by a system member at all — came from testing against an |
| 59 | +-- entity that did not store one. |
| 60 | +-- |
| 61 | +-- Verify: |
| 62 | +-- |
| 63 | +-- mxcli exec create-output-variable-and-sort-path.mdl -p app.mpr |
| 64 | +-- mx check -p app.mpr -- 0 errors |
| 65 | +-- |
| 66 | +-- Use `mx check` DIRECTLY, not `mxcli docker check`: that command runs |
| 67 | +-- `mx update-widgets` first and can mask a model-level failure. |
| 68 | +-- |
| 69 | +-- Then perturb, one at a time: |
| 70 | +-- |
| 71 | +-- stub freshCreateVariable to return "" |
| 72 | +-- -> CE6005 on every unassigned create, and mxcli check still passes. |
| 73 | +-- |
| 74 | +-- change `sort by createdDate` to `sort by System.createdDate` |
| 75 | +-- -> refused by exec now. Before the fix: written, and the project could no |
| 76 | +-- longer be opened by mxbuild or Studio Pro. |
| 77 | + |
| 78 | +create module CrSort; |
| 79 | +/ |
| 80 | + |
| 81 | +-- The entity must STORE createdDate for a sort on it to resolve — that is what |
| 82 | +-- the AutoCreatedDate pseudo-type sets. |
| 83 | +create or modify persistent entity CrSort.Item ( |
| 84 | + Code: String(20), |
| 85 | + CreatedDate: AutoCreatedDate |
| 86 | +); |
| 87 | +/ |
| 88 | + |
| 89 | +create or modify entity CrSort.Region ( Name: String(50) ); |
| 90 | +/ |
| 91 | + |
| 92 | +-- §9: the reported case, twice over. Two unassigned creates of the SAME entity |
| 93 | +-- must not end up sharing an output variable — Mendix reports that as CE0119, so |
| 94 | +-- a bare "New"+entity would trade one silent defect for another. |
| 95 | +create or modify microflow CrSort.ACT_Unassigned () |
| 96 | +begin |
| 97 | + CREATE CrSort.Region ( Name = 'North' ) COMMIT; |
| 98 | + CREATE CrSort.Region ( Name = 'South' ) COMMIT; |
| 99 | +end; |
| 100 | +/ |
| 101 | + |
| 102 | +-- CONTROL for §9: an assigned create keeps the AUTHOR's name, and that name is |
| 103 | +-- still referenceable afterwards. Without this a fix that always generated a name |
| 104 | +-- would look correct above. |
| 105 | +create or modify microflow CrSort.ACT_Assigned () |
| 106 | +begin |
| 107 | + $R = CREATE CrSort.Region ( Name = 'East' ) COMMIT; |
| 108 | + CHANGE $R ( Name = 'West' ); |
| 109 | + COMMIT $R; |
| 110 | +end; |
| 111 | +/ |
| 112 | + |
| 113 | +-- §46: the spelling that works. A bare system member on an entity that stores it. |
| 114 | +create or modify microflow CrSort.ACT_SortBare () |
| 115 | +begin |
| 116 | + RETRIEVE $Rows FROM CrSort.Item SORT BY createdDate ASC; |
| 117 | + LOG INFO 'done'; |
| 118 | +end; |
| 119 | +/ |
| 120 | + |
| 121 | +-- CONTROL for §46: an ordinary attribute, and a fully qualified three-part path. |
| 122 | +-- The existing belongs-to-the-entity check owns the three-part case and must stay |
| 123 | +-- permissive; a fix that refused every dotted path would break this. |
| 124 | +create or modify microflow CrSort.ACT_SortOther () |
| 125 | +begin |
| 126 | + RETRIEVE $Rows FROM CrSort.Item SORT BY Code DESC; |
| 127 | + RETRIEVE $Rows2 FROM CrSort.Item SORT BY CrSort.Item.Code ASC; |
| 128 | + LOG INFO 'done'; |
| 129 | +end; |
| 130 | +/ |
0 commit comments