You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: preserve rule split describer output and free annotations
The microflow describer round-trip was lossy in three ways after the
rule-split parser landed:
1. `DESCRIBE MICROFLOW` of an IF whose condition was a RuleSplitCondition
silently emitted `if true then`, because the ExclusiveSplit formatter
only recognised ExpressionSplitCondition. `describe -> exec` demoted
every rule-based decision to `if true` — the MPR still loaded but
Studio Pro showed the wrong condition.
2. `@caption` was only emitted for ActionActivity. Splits store their
human-readable label (e.g. "Right format?") on the split itself, not
on the expression, so round-tripping the describer output produced
an ExclusiveSplit with no caption even when Mendix had one.
3. Free-floating Annotation objects (those without an AnnotationFlow
pointing to them) were silently dropped by the describer, losing
author/date comments on flows that contained no activities.
The IF flow builder also emitted a dangling SequenceFlow whenever a
nested IF had `thenReturns` in an outer context with `needMerge=false`,
because the flow-emission check only looked at `!thenReturns`. Studio
Pro rejected the resulting MPR with "Sequence contains no matching
element". Guard the three branch-to-merge flows on `needMerge` so the
parent handles the continuation.
Changes:
- `cmd_microflows_format_action.go`: extract `formatSplitCondition`
helper that renders ExpressionSplitCondition verbatim and
RuleSplitCondition as `Module.RuleName(Param = arg, ...)` using the
already-parsed `RuleQualifiedName` and `ParameterName` fields.
- `cmd_microflows_show_helpers.go`: emit `@caption` for ExclusiveSplit
and InheritanceSplit when a caption is present.
- `cmd_microflows_show.go`: prepend free-floating annotations as
`@annotation` entries on the first activity in both `describeMicroflow`
and `renderMicroflowMDL`.
- `cmd_microflows_builder_control.go`: add `&& needMerge` guards to
all three branch-to-merge flow emissions so empty mergeID never
reaches the BSON writer.
- `sdk/mpr/writer_core.go`: document that an empty id in
`idToBsonBinary` indicates a caller bug rather than a valid input —
the random-UUID fallback produces references to nothing and shows up
in Studio Pro as KeyNotFoundException.
Depends on `submit/microflow-split-subtype-preservation` for the
`RuleQualifiedName` / `ParameterName` fields on RuleSplitCondition /
RuleCallParameterMapping and for the RuleCall-aware parser.
0 commit comments