forked from mendixlabs/mxcli
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
Mendix special XPath tokens ([%CurrentDateTime%], [%CurrentUser%], etc.) are incorrectly written to BSON as quoted string literals ('[%CurrentDateTime%]'). This causes CE0161 (XPath parse error) when the project is opened in Studio Pro.
Repro
CREATE PERSISTENT ENTITY XpathTest.Order ( OrderDate: DateTime );
CREATE MICROFLOW XpathTest.GetRecentOrders () RETURNS List of XpathTest.Order (
RETRIEVE $Orders FROM DATABASE XpathTest.Order
WHERE $this/OrderDate > [%CurrentDateTime%]
RETURN $Orders
);Result: CE0161 XPath '[%CurrentDateTime%]' for constraint of retrieve ... is invalid
Root cause
The MDL writer treats the token as a string and wraps it in single quotes in the BSON XPath field. Mendix expects the token unquoted inside the constraint expression.
Impact
- Any XPath constraint using
[%CurrentDateTime%],[%CurrentUser%],[%BeginOfCurrentDay%], etc. produces a broken project - File
16-xpath-examples.mdlfails mx check with this error
Severity
HIGH — runtime XPath error, project is non-functional.
Discovered via
Automated roundtrip test — mdl-examples/doctype-tests/16-xpath-examples.mdl (2026-03-25)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working