Environment: mxcli v0.16.0-410-g4fda072f (built from 4fda072f), Mendix 11.13.0 project, macOS.
Steps to reproduce:
create or modify persistent entity ZZD.Doc extends System.FileDocument (
);
/
create or modify microflow ZZD.ACT_Download (
$Doc: ZZD.Doc
)
returns Boolean
begin
download file $Doc;
return true;
end;
/
Run mxcli exec script.mdl -p project.mpr, then describe microflow ZZD.ACT_Download and mx check project.mpr.
Expected behavior: The activity is stored as a Microflows$DownloadFileAction and round-trips as download file $Doc;.
Actual behavior: mxcli check passes and mxcli exec reports Created microflow with no warning. The activity is written with no action at all:
begin
...
-- Empty action
return true;
end;
mx check then reports:
[error] [CE0008] "No action defined." at Action activity 'Activity'
The statement is accepted at every stage that reports anything, and disappears at the one stage that does not. download file $Doc show in browser; behaves the same.
Root cause: the write path has no case for it. actionToGen in mdl/backend/modelsdk/microflow_write.go switches on *microflows.<Action> and covers ~80 action types; DownloadFileAction is not among them (grep -c DownloadFileAction microflow_write.go → 0), so the ActionActivity is emitted with a nil Action.
Everything either side of the writer is already in place, which is what makes this easy to miss:
- grammar/visitor:
downloadFileStatement → ast.DownloadFileStmt (mdl/visitor/visitor_microflow_actions.go:1193)
- flow builder:
addDownloadFileAction builds a correct microflows.DownloadFileAction (mdl/executor/cmd_microflows_builder_calls.go:845)
- read path:
actionFromGen handles it (mdl/backend/modelsdk/microflow_read_actions.go:376), covered by TestActionFromGen_DownloadFile
- formatter:
mdl/executor/cmd_microflows_format_action.go:737
So there is a builder test and a reader test, and the only untested link is the one that is missing. docs/11-proposals/PROPOSAL_microflow_download_file_statement.md:53 lists "Builder/writer coverage for DownloadFileAction" as required — the builder half landed, the writer half did not.
Suggested fix: add a case *microflows.DownloadFileAction to actionToGen in microflow_write.go, writing FileDocumentVariableName, ShowFileInBrowser and ErrorHandlingType. Note the storage key is ShowFileInBrowser, not ShowInBrowser — the reader test above documents that legacy reads the wrong key.
A round-trip test (exec → describe) would catch this class generally; a reader-only test cannot, because it starts from BSON that the writer never had to produce.
Environment: mxcli
v0.16.0-410-g4fda072f(built from4fda072f), Mendix 11.13.0 project, macOS.Steps to reproduce:
Run
mxcli exec script.mdl -p project.mpr, thendescribe microflow ZZD.ACT_Downloadandmx check project.mpr.Expected behavior: The activity is stored as a
Microflows$DownloadFileActionand round-trips asdownload file $Doc;.Actual behavior:
mxcli checkpasses andmxcli execreportsCreated microflowwith no warning. The activity is written with no action at all:mx checkthen reports:The statement is accepted at every stage that reports anything, and disappears at the one stage that does not.
download file $Doc show in browser;behaves the same.Root cause: the write path has no case for it.
actionToGeninmdl/backend/modelsdk/microflow_write.goswitches on*microflows.<Action>and covers ~80 action types;DownloadFileActionis not among them (grep -c DownloadFileAction microflow_write.go→ 0), so theActionActivityis emitted with a nilAction.Everything either side of the writer is already in place, which is what makes this easy to miss:
downloadFileStatement→ast.DownloadFileStmt(mdl/visitor/visitor_microflow_actions.go:1193)addDownloadFileActionbuilds a correctmicroflows.DownloadFileAction(mdl/executor/cmd_microflows_builder_calls.go:845)actionFromGenhandles it (mdl/backend/modelsdk/microflow_read_actions.go:376), covered byTestActionFromGen_DownloadFilemdl/executor/cmd_microflows_format_action.go:737So there is a builder test and a reader test, and the only untested link is the one that is missing.
docs/11-proposals/PROPOSAL_microflow_download_file_statement.md:53lists "Builder/writer coverage forDownloadFileAction" as required — the builder half landed, the writer half did not.Suggested fix: add a
case *microflows.DownloadFileActiontoactionToGeninmicroflow_write.go, writingFileDocumentVariableName,ShowFileInBrowserandErrorHandlingType. Note the storage key isShowFileInBrowser, notShowInBrowser— the reader test above documents that legacy reads the wrong key.A round-trip test (
exec→describe) would catch this class generally; a reader-only test cannot, because it starts from BSON that the writer never had to produce.