Skip to content

No MDL for Send/Delete external object: OData write flows cannot be authored, and the drop+create rebuild that MDL-V1-REBUILD recommends deletes the send silently #1735

Closed

Description

@dimenus

Environment: mxcli v0.30.0-47-g6094f471f (built from 6094f471f, the current main), Mendix 11.16.1 project (MPR v2), macOS. The app consumes an OData v4 service with updatable external entities.

Summary: There is no MDL statement for the Send external object (Microflows$SendExternalObject) and Delete external object (Microflows$DeleteExternalObject) activities. This has two effects:

  1. A microflow that writes an external entity cannot be authored in MDL at all. Studio Pro refuses a plain commit on an external entity ("…because it is an external entity. Use the 'Send external object' activity instead"), so there is no MDL way to save one.
  2. The drop-and-create rebuild, which the MDL-V1-REBUILD refusal recommends, deletes an existing send activity silently. check passes, exec prints no warning, and the activity is gone.

Steps to reproduce:

A stored microflow that changes an external object and sends it:

$ mxcli -p InventoryAdmin.mpr -c "describe microflow Main.ACT_District_DeleteClose"
...
begin
  @start(-2146, 57)
  $MxSystemUser = call microflow InventoryApi.GetMxSystemUserForDistrict(District = $District);
  change $District (Active = false);
  -- Unsupported action: Microflows$SendExternalObject
  call microflow Main.ASUB_District_Delete(DistrictId = $District/IntDistrictID) in queue Main.TQ_ResourceCleanup;
  close page 2147483647;
  show page Main.District_Overview;
  return;
end;
  1. Save that output to rt.mdl, add one statement after the change, and strip the @position/@start/@curve/@anchor lines. create or modify splices the new statement in and keeps the send. This path is fine.
  2. With the positions kept, create or modify is refused (MDL-V1-REBUILD). The message says: "to rebuild the flow deliberately, drop the microflow and create it in the same script".
  3. Do exactly that: drop microflow Main.ACT_District_DeleteClose; followed by the same create or modify microflow … from step 1.
$ mxcli check rt4.mdl -p InventoryAdmin.mpr --references
...
Check passed!
$ mxcli exec rt4.mdl -p InventoryAdmin.mpr
Dropped microflow: Main.ACT_District_DeleteClose
  Removed its execute grants to Main.User. ...
Created microflow: Main.ACT_District_DeleteClose
$ mxcli -p InventoryAdmin.mpr -c "describe microflow Main.ACT_District_DeleteClose" | grep -c SendExternalObject
0

Expected behavior:

  • send external object $Var [refresh in client]; and delete external object $Var [refresh in client]; exist, with the usual on error … handling. Both round-trip through describe.
  • Until they exist, check/exec refuse a script that recreates a flow whose stored version holds an UnsupportedAction. A -- Unsupported action: line in the source of a create should be an error, not a comment that is dropped.

Actual behavior: The activity is described as a comment. Every path that rebuilds the flow from that text writes it without the activity, and reports success. The changed attribute values are then never sent to the service. Nothing fails at build time, because a microflow with no send is valid. The data is simply not saved.

Root cause:

  • The reader has no case for either type. actionFromGen returns nil, so mdl/backend/modelsdk/microflow.go:663 stores &microflows.UnsupportedAction{StorageType: …}.
  • sdk/microflows/microflows_actions.go:1571 documents that UnsupportedAction is deliberately inert on the write side: "microflowActionToGen has no case for it, so an UnsupportedAction never reaches BSON".
  • The formatter prints it as a comment (mdl/executor/cmd_microflows_format_action.go:368), and a comment parses to nothing.
  • The splice path keeps the stored activity because it does not rewrite it. The drop+create path has no stored activity to keep.
  • The generated types already exist: modelsdk/gen/microflows/types.go:10412 (SendExternalObject: errorHandlingType, variableNameToBeSent, refreshInClient) and :3013 (DeleteExternalObject: errorHandlingType, deleteVariableName, refreshInClient). So the missing parts are the grammar, AST, builder, reader, writer and formatter, which is the same set Feature: MDL support for the built-in Send Email microflow activity (Studio Pro 11.13+ beta, Microflows$SendEmailAction) #1315 added for Send Email.

Suggested fix:

  1. Add the two statements end to end, with a round-trip test (exec → describe → exec gives no change). A reader-only test cannot catch a missing writer case (see download file is parsed and built but never written: activity lands in the .mpr with no action (CE0008) #850).
  2. Separately, and smaller: when a script drops a flow and creates it again, compare the stored flow's UnsupportedActions with the new body. Refuse if any would be lost, and name them. DESCRIBE NANOFLOW renders SynchronizeAction as -- Empty action, and the fallback co mment silently drops the activity's entire error handler #863 made the activity visible in describe. This would make losing it loud as well.

Workaround used: write everything else in MDL, then add the send activity through Studio Pro (by hand or through its MCP ped_update_document).

Activity

  1. added a commit that references this issue on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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