Skip to content

Parser Feature Request: Support RETRIEVE FROM $Parent/Association for in-memory & NPE lists #22

@MauVisser

Description

@MauVisser

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:

  1. Direct Retrieve (Expected MDL Syntax):
    RETRIEVE $List FROM $Parent/Module.AssociationName;
    Result: Parse error — $Parent unexpected after FROM
  2. Variable Assignment:
    SET $List = $Parent/Module.AssociationName;
    Result: CE0117 — cannot traverse 1-to-many in expression
  3. Loop Over:
    LOOP $Item OVER $Parent/Module.AssociationName
    Result: Parse error — OVER not supported, only IN

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.

Metadata

Metadata

Assignees

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