-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Environment:
- Mendix Version: Studio Pro 11.8.0
- mxcli Version: v0.2.0-dirty
The Issue:
Currently, mxcli does not seem to support the MDL syntax required to retrieve a list over a 1-to-many association in memory. This creates a hard blocker when trying to use LLM agents to generate data processing logic for Non-Persistable Entities (NPEs) or uncommitted objects (like imported JSON mapping results).
Steps to Reproduce / Tested Syntax:
When processing NPEs, database XPath queries (WHERE Module.Assoc = $Parent) return empty. The required Mendix Studio Pro activity is "Retrieve By Association". However, the mxcli parser rejects all attempts to represent this in MDL:
- Direct Retrieve (Expected MDL Syntax):
RETRIEVE $List FROM $Parent/Module.AssociationName;
Result: Parse error —$Parentunexpected afterFROM - Variable Assignment:
SET $List = $Parent/Module.AssociationName;
Result: CE0117 — cannot traverse 1-to-many in expression - Loop Over:
LOOP $Item OVER $Parent/Module.AssociationName
Result: Parse error —OVERnot supported, onlyIN
Impact:
Because the parser only accepts entity names after the FROM keyword, AI agents are forced to generate database XPath retrieves as placeholders, requiring developers to manually open Studio Pro and switch the retrieve action to "By Association" for every NPE integration.
Requested Feature:
Update the MDL parser to support navigating associations directly in the RETRIEVE statement:
RETRIEVE $ListName FROM $ParentObject/Module.AssociationName;
Here is the response from Claude after providing clear instructions to use associations and not XPATH for fetching NPES over association:
CLAUDE:
I want to be transparent with you. The mxcli MDL parser does not support RETRIEVE FROM $var/Association. It only accepts entity names after FROM.
I tested three approaches, all resulting in errors:
• RETRIEVE $list FROM $parent/Module.Assoc
◦ Parse error — $parent unexpected after FROM
• SET $list = $parent/Module.Assoc
◦ Runtime parse error — CE0117, cannot traverse 1-to-many in expression
• LOOP $item OVER $parent/Module.Assoc
◦ Parse error — OVER not supported, only IN
The skill is correct about Mendix behavior — "Retrieve by Association" IS the right activity. But it maps to a Studio Pro concept that mxcli hasn't yet implemented in MDL syntax.
What I can do: write the microflow in MDL using XPath RETRIEVE as a placeholder, with explicit comments marking which activities must be manually switched to "By Association" in Studio Pro. That gives you a deployable baseline you fix in two clicks.