Problem
When a nanoflow contains a create list of … or add … to list activity, mx check rejects the project with CE6035 "Error handling type is not supported". The same error fires for call nanoflow … on error continue.
Reproduction (originally hit while expanding mdl-examples/doctype-tests/02b-nanoflow-examples.mdl):
create non-persistent entity NfBug.Summary ( Name : String(200) );
create entity NfBug.Product ( Name : String(200) );
create nanoflow NfBug.DS_Summaries ()
returns List of NfBug.Summary
begin
retrieve $Products from NfBug.Product;
$Summaries = create list of NfBug.Summary;
loop $P in $Products
begin
$S = create NfBug.Summary (Name = $P/Name);
add $S to $Summaries;
end loop;
return $Summaries;
end;
mx check output on the resulting MPR:
[error] [CE6035] "Error handling type is not supported" at Create list activity 'Create list of Summary'
[error] [CE6035] "Error handling type is not supported" at Change list activity 'Add to list Summaries'
Root cause
sdk/mpr/writer_microflow_actions.go unconditionally writes ErrorHandlingType: "Rollback":
CreateListAction — hardcoded "Rollback" (line 386)
ChangeListAction — hardcoded "Rollback" (line 399)
NanoflowCallAction — defaults to "Rollback" via stringOrDefault (line 251)
Dumping Viewer3D.GetModelListFromMendix from the LatoProductInventory reference project (authored in Studio Pro) shows the same activities use "Abort" in a nanoflow context:
$ mxcli -p LatoProductInventory.mpr bson dump -t nanoflow -o Viewer3D.GetModelListFromMendix | grep -B1 -A1 ErrorHandlingType
"Key": "ErrorHandlingType", "Value": "Abort"
...
So the writer is using the microflow default ("Rollback") for activities serialized inside a nanoflow. The shared serializeMicroflowAction path has no nanoflow-vs-microflow context to switch on.
Note: NanoflowCallAction with the default Rollback happens to be accepted by mx check, but explicit on error continue (which writes "Continue") is rejected. The hardcoded default papered over the bug for the original 02b examples, which only used call nanoflow and no list ops.
Suggested fix
- Writer — thread an
isNanoflow bool flag through serializeMicroflowAction (called from both serializeMicroflow and serializeNanoflow in sdk/mpr/writer_microflow.go:804). When isNanoflow, default ErrorHandlingType to "Abort" for CreateListAction, ChangeListAction, NanoflowCallAction (and likely others — worth a sweep). The existing AST value should still win when explicitly set.
- AST / executor — surface a nanoflow-friendly default in
mdl/types/ so the executor doesn't need to know the writer's convention.
- MDL surface — add
on error abort keyword to the grammar (alongside today's continue / rollback / handler block) so authors can pin the behaviour explicitly. Check the Mendix metamodel for any other nanoflow-only values worth exposing.
- Test coverage — add a nanoflow loop-and-build-list example to
mdl-examples/doctype-tests/02b-nanoflow-examples.mdl (currently removed to keep the test green) so the regression is caught next time. A unit test in sdk/mpr/ that asserts ErrorHandlingType == "Abort" on a list action serialized via serializeNanoflow would pin the writer behaviour.
Why this matters
The loop-and-build-list pattern is the canonical way to project a persistent list into a view-model list in Mendix nanoflows — used heavily across Viewer3D, WorkflowCommons, and the Atlas data-source helpers. Without this fix, mxcli can't faithfully reproduce a large class of real nanoflows.
Found during
Expanding mdl-examples/doctype-tests/02b-nanoflow-examples.mdl with representative patterns from EnquiriesManagement, LatoProductInventory, Evora-FactoryManagement. The expanded file dropped the loop-build-list pattern (Pattern 9 in the original draft) and the call nanoflow … on error continue pattern until this bug is fixed.
Problem
When a nanoflow contains a
create list of …oradd … to listactivity,mx checkrejects the project withCE6035 "Error handling type is not supported". The same error fires forcall nanoflow … on error continue.Reproduction (originally hit while expanding
mdl-examples/doctype-tests/02b-nanoflow-examples.mdl):mx checkoutput on the resulting MPR:Root cause
sdk/mpr/writer_microflow_actions.gounconditionally writesErrorHandlingType: "Rollback":CreateListAction— hardcoded"Rollback"(line 386)ChangeListAction— hardcoded"Rollback"(line 399)NanoflowCallAction— defaults to"Rollback"viastringOrDefault(line 251)Dumping
Viewer3D.GetModelListFromMendixfrom theLatoProductInventoryreference project (authored in Studio Pro) shows the same activities use"Abort"in a nanoflow context:So the writer is using the microflow default ("Rollback") for activities serialized inside a nanoflow. The shared
serializeMicroflowActionpath has no nanoflow-vs-microflow context to switch on.Note:
NanoflowCallActionwith the default Rollback happens to be accepted bymx check, but expliciton error continue(which writes"Continue") is rejected. The hardcoded default papered over the bug for the original 02b examples, which only usedcall nanoflowand no list ops.Suggested fix
isNanoflow boolflag throughserializeMicroflowAction(called from bothserializeMicroflowandserializeNanoflowinsdk/mpr/writer_microflow.go:804). WhenisNanoflow, defaultErrorHandlingTypeto"Abort"forCreateListAction,ChangeListAction,NanoflowCallAction(and likely others — worth a sweep). The existing AST value should still win when explicitly set.mdl/types/so the executor doesn't need to know the writer's convention.on error abortkeyword to the grammar (alongside today'scontinue/rollback/ handler block) so authors can pin the behaviour explicitly. Check the Mendix metamodel for any other nanoflow-only values worth exposing.mdl-examples/doctype-tests/02b-nanoflow-examples.mdl(currently removed to keep the test green) so the regression is caught next time. A unit test insdk/mpr/that assertsErrorHandlingType == "Abort"on a list action serialized viaserializeNanoflowwould pin the writer behaviour.Why this matters
The loop-and-build-list pattern is the canonical way to project a persistent list into a view-model list in Mendix nanoflows — used heavily across
Viewer3D,WorkflowCommons, and the Atlas data-source helpers. Without this fix, mxcli can't faithfully reproduce a large class of real nanoflows.Found during
Expanding
mdl-examples/doctype-tests/02b-nanoflow-examples.mdlwith representative patterns fromEnquiriesManagement,LatoProductInventory,Evora-FactoryManagement. The expanded file dropped the loop-build-list pattern (Pattern 9 in the original draft) and thecall nanoflow … on error continuepattern until this bug is fixed.