Skip to content

DESCRIBE MICROFLOW invents an on error rollback clause on activities that never had one #840

Description

@MendixMau

Solution exists in fork: engalar/mxcli fixed this in two commits — e28d4ac3e
(2026-05-23, commit activities) and 014ea7ea5 (2026-05-26, extended to call microflow /
import from mapping). The fix is a one-line design decision at the read-back layer with an
explicit code comment explaining why — should be directly portable.

Environment: mxcli (RnD/upstream), Mendix 11.12.0 project.

Steps to reproduce:

create module ZZB;
/
create microflow ZZB.SUB_Handle (
  "ErrorMessage": String
)
returns Boolean as $Ok
begin
  declare $Ok boolean = true;
  return $Ok;
end;
/
create microflow ZZB.ACT_R11 ()
returns Boolean as $Result
begin
  declare $Result boolean = false;

  -- Written with NO error clause.
  $Sub = call microflow ZZB.SUB_Handle("ErrorMessage" = 'probe');

  set $Result = true;
  return $Result;
end;

Run mxcli exec script.mdl -p project.mpr, then mxcli describe microflow ZZB.ACT_R11 (the
call microflow activity was written with no on error clause at all).

Expected behavior: Read-back should not print an on error clause for an activity the
source script never gave one.

Actual behavior: mx check passes clean (0 errors) — on error rollback is a perfectly
valid clause to Studio Pro, so validation can't distinguish "user wrote this" from "tool
invented this." DESCRIBE MICROFLOW prints on error rollback on the call microflow
activity even though the source script never wrote one.

Root cause per the fork's fix: this is not a write-path bug — the write path always stores
ErrorHandlingType: "Rollback" as the BSON default (unavoidable; Mendix's BSON schema has no
"unset" value for this field). Since a stored "Rollback" is structurally indistinguishable
from "the user never wrote a clause," the fix is entirely at the describe/read-back layer: the
formatter was changed to never emit on error rollback in read-back output at all. It only
ever emits on error continue, since "Continue" is never the default and therefore always
means the user wrote it explicitly. Documented directly in the fork's source
(microflows_format_action_v2.go / microflows_format_calls_v2.go):

// Note: ErrorHandlingType is always "Rollback" for commit activities in
// microflows (it is the BSON default). The MDL "on error rollback" modifier
// is therefore indistinguishable from a plain commit in stored BSON and is
// not emitted here.

Suggested fix: adopt the identical rule in RnD's formatter — never print on error rollback for activities where it's the BSON default; only print on error continue (or any
other explicit non-default value).

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