Skip to content

Commit 8468e58

Browse files
committed
draft: stage remaining microflow roundtrip fixes
Symptom: the focused upstream PR set does not yet include every local roundtrip-validity fix found during long-running audits of large legacy Mendix projects. Root cause: several remaining fixes are intertwined across microflow control-flow reconstruction, handler routing, split/case preservation, validation, and writer/parser compatibility. They need further extraction before they are suitable for review as individual upstream PRs. Fix: stage the remaining all-fixes tree as one draft branch so the outstanding local work is visible upstream while smaller PRs continue to be split out from it. This draft is not intended to merge as-is. Tests: make build, make test, and make lint-go pass on the staged tree.
1 parent 6c4b0d2 commit 8468e58

78 files changed

Lines changed: 21474 additions & 12317 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/mxcli-dev/review.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ proactively. Add a row after every review that surfaces something new.
3232
| 7 | Skill/doc table references a function that doesn't exist (e.g. `formatActionStatement()` vs `formatAction()`) | Docs quality | Grep function names before writing: `grep -r "func formatA" mdl/executor/` |
3333
| 8 | "Always X" rule is too absolute for trivial edge cases (e.g. "always write failing test first" for one-char typos) | Docs quality | Soften to "prefer X" or add an exception clause; include the reasoning so readers can judge edge cases |
3434
| 9 | Doc comment promises a fallback/feature that doesn't exist in the code (e.g., "raw-map fallback in the client" when no such fallback was implemented) | Docs quality | Grep for function/type names referenced in doc comments to confirm they exist before committing |
35+
| 10 | New MDL keyword or statement added without a parser example in `mdl-examples/` | Syntax feature | Add a minimal `mdl-examples/doctype-tests/*.mdl` fixture and include the statement in the quick reference before review |
36+
| 11 | Commit titled `fix:` actually introduces new MDL syntax | Scope & atomicity | Split the syntax addition into a `feat:` or proposal-backed PR; keep bug fixes separate from language design |
37+
| 12 | Round-trip bug patched on only one half of parse/write | DESCRIBE/EXEC symmetry | Fix both parser/defaulting and writer serialization, then add tests for missing/default fields and explicit fields |
3538

3639
---
3740

.claude/skills/mendix/write-microflows.md

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -729,35 +729,6 @@ retrieve $Items from Module.Entity where Active = true;
729729

730730
**Note**: `returns type as $Var` in the microflow signature does NOT create an activity variable — it only names the return value. So `$Var = call java action ...` after `returns as $Var` is fine (one creation).
731731

732-
## Legacy SOAP Web Service Calls
733-
734-
`call web service` preserves legacy Mendix SOAP activities. Prefer REST clients
735-
for new integrations; this syntax exists mainly so existing projects can
736-
round-trip without dropping SOAP actions.
737-
738-
```mdl
739-
-- Structured form. DESCRIBE prefers Module.Document names when references are resolvable.
740-
$Root = call web service 'SampleSOAP.OrderService'
741-
operation 'FetchSampleItems'
742-
send mapping 'SampleSOAP.OrderRequest'
743-
receive mapping 'SampleSOAP.OrderResponse'
744-
timeout 30
745-
on error rollback;
746-
747-
-- Raw IDs are accepted when old project references are dangling or unavailable.
748-
$Root = call web service 'sample-service-id'
749-
operation 'FetchSampleItems'
750-
send mapping 'sample-send-mapping-id'
751-
receive mapping 'sample-receive-mapping-id';
752-
753-
-- Raw escape hatch emitted for unsupported SOAP fields.
754-
$Root = call web service raw 'AQID';
755-
```
756-
757-
**Design note:** the raw payload is base64-encoded BSON for the complete action
758-
and is authoritative on re-exec. Treat this as round-trip support, not a
759-
recommended authoring format for new integrations.
760-
761732
## REST Service Calls
762733

763734
MDL supports two patterns for calling REST APIs from microflows:
@@ -854,11 +825,35 @@ rest call delete 'https://api.example.com/items/{1}' with (
854825

855826
**REST CALL supports full error handling** (`on error continue`, `on error rollback`, custom error handlers).
856827

828+
## Legacy SOAP Web Service Calls
829+
830+
`call web service` preserves legacy Mendix SOAP activities. Prefer REST clients
831+
for new integrations; this syntax exists mainly so existing projects can round-trip
832+
without dropping SOAP actions.
833+
834+
```mdl
835+
-- Structured passthrough form using Mendix document IDs.
836+
$Root = call web service 'sample-service-id'
837+
operation 'FetchSampleItems'
838+
send mapping 'sample-send-mapping-id'
839+
receive mapping 'sample-receive-mapping-id'
840+
timeout 30
841+
on error rollback;
842+
843+
-- Raw escape hatch emitted by describe when the SOAP action has fields that
844+
-- are not expressible yet. The base64 payload is the authoritative BSON action.
845+
$Root = call web service raw 'AQID';
846+
```
847+
848+
**Design note:** service and mapping references are currently opaque Mendix IDs,
849+
not qualified names. Treat this as round-trip support, not a recommended authoring
850+
syntax for new SOAP actions.
851+
857852
## File Downloads
858853

859854
Use `download file` to stream a `System.FileDocument` from a microflow. Add
860-
`show in browser` when the action should open the file inline instead of forcing
861-
a download.
855+
`show in browser` when Studio Pro's action should open the file inline instead
856+
of forcing a download.
862857

863858
```mdl
864859
download file $GeneratedReport show in browser;
@@ -880,9 +875,9 @@ $Total = call java action SampleModule.Recalculate(
880875
);
881876
```
882877

883-
`...` is a round-trip-only placeholder. New scripts should bind every
884-
parameter to a real expression; reach for `...` only when regenerating MDL
885-
from an existing project that already had unbound parameters.
878+
`...` is a *round-trip-only* placeholder. New scripts should bind every
879+
parameter to a real expression; reach for `...` only when you're regenerating
880+
MDL from an existing project that already had unbound parameters.
886881

887882
## Error Handling
888883

docs/11-proposals/PROPOSAL_microflow_call_web_service_statement.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ callWebServiceStatement
5050
(RECEIVE MAPPING STRING_LITERAL)?
5151
(TIMEOUT expression)?)
5252
onErrorClause?
53+
SEMICOLON
5354
;
5455
```
5556

@@ -71,20 +72,20 @@ syntax covers them.
7172

7273
## Tests And Examples
7374

74-
- Parser/visitor coverage for structured and raw forms.
75-
- Builder/writer coverage for real `WebServiceCallAction` construction and raw
76-
BSON preservation.
77-
- Formatter coverage for qualified-name resolution and raw-ID fallback.
75+
- Parser/visitor coverage: `TestCallWebServiceStatement` and
76+
`TestCallWebServiceRawStatement`.
77+
- Builder/writer coverage: `TestBuildFlowGraph_WebServiceCallCreatesRealAction`,
78+
`TestBuildFlowGraph_WebServiceCallPreservesRawBSON`, and MPR RawBSON tests.
7879
- Example script: `mdl-examples/doctype-tests/call_web_service.test.mdl`.
7980

80-
## Resolved Questions
81-
82-
- Service and mapping references are emitted as `Module.Document` names when
83-
the backend can resolve them. Raw IDs remain the fallback for dangling
84-
references and incomplete project metadata.
85-
8681
## Open Questions
8782

8883
- Should the raw payload eventually move to a generic
8984
`raw microflow action '...'` escape hatch instead of remaining under
9085
`call web service raw`?
86+
87+
## Resolved Questions
88+
89+
- Service and mapping references are emitted as `Module.Document` names when
90+
the backend can resolve them. Raw IDs remain the fallback for dangling
91+
references and incomplete project metadata.

docs/11-proposals/PROPOSAL_microflow_download_file_statement.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ activity without adding new semantics.
1818

1919
Projects that already contain download-file actions should survive
2020
describe/exec/describe without losing the activity or falling back to an
21-
unsupported-action comment. The statement also gives users a straightforward way
22-
to author file downloads when the file document variable already exists.
21+
unsupported-action comment. The statement also gives users a straightforward
22+
way to author file downloads when the file document variable already exists.
2323

2424
## Syntax
2525

@@ -44,6 +44,8 @@ download file $GeneratedReport show in browser on error rollback;
4444

4545
## Tests And Examples
4646

47-
- Parser/visitor coverage for both normal and `show in browser` forms.
48-
- Builder/writer coverage for `DownloadFileAction`.
47+
- Parser/visitor coverage: `TestDownloadFileStatement`.
48+
- Builder/writer coverage: `TestBuildFlowGraph_DownloadFileCreatesRealAction`
49+
and MPR parser tests for `DownloadFileAction`.
4950
- Example script: `mdl-examples/doctype-tests/download_file.test.mdl`.
51+

docs/11-proposals/PROPOSAL_microflow_variable_alias_collision.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ deterministic and reviewable.
3939
- The first output keeps its original name.
4040
- Later outputs are renamed to the first available suffix:
4141
`Foo_2`, `Foo_3`, and so on.
42-
- Subsequent variable references and attribute paths are rewritten to the active
43-
alias.
42+
- Subsequent references in variables, paths, and preserved source expressions
43+
are rewritten to the active alias.
4444
- Moving to a different position resets the alias for that variable name.
4545

4646
This is primarily a describe/round-trip preservation rule. Authored MDL should

docs/11-proposals/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ BSON schema Registry ◄──── multi-version Support
4343
|----------|--------|---------|------------|
4444
| [MDL Syntax Improvements v1](PROPOSAL_mdl_syntax_improvements.md) | Draft | Go-style assignment, C-style braces, fluent list APIs ||
4545
| [MDL Syntax Improvements v2](PROPOSAL_mdl_syntax_improvements_v2.md) | Proposed | Consolidated v2: unified variable declaration, C-style braces, fluent list ops | Syntax Improvements v1 |
46-
| [Microflow Free Annotation](PROPOSAL_microflow_free_annotation.md) | Draft | Order-sensitive `@annotation` handling for free-floating visual notes in microflows ||
4746
| [Microflow Download File Statement](PROPOSAL_microflow_download_file_statement.md) | Draft | `download file $FileDocument [show in browser]` for `DownloadFileAction` round-trip and authoring ||
48-
| [Microflow Call Web Service Statement](PROPOSAL_microflow_call_web_service_statement.md) | Draft | Structured and raw MDL syntax for legacy SOAP `CallWebServiceAction` round-trip preservation ||
47+
| [Microflow Call Web Service Statement](PROPOSAL_microflow_call_web_service_statement.md) | Draft | Legacy SOAP `CallWebServiceAction` preservation, including a raw BSON escape hatch ||
4948
| [Ellipsis Placeholder Expression](PROPOSAL_ellipsis_placeholder_expression.md) | Draft | `...` placeholder for unbound code-action parameters; round-trip preservation of empty `BasicCodeActionParameterValue` bindings ||
5049
| [Microflow Variable Alias Collision](PROPOSAL_microflow_variable_alias_collision.md) | Draft | Deterministic `Foo_2` aliases for duplicate implicit outputs at the same microflow position ||
50+
| [Microflow Free Annotation](PROPOSAL_microflow_free_annotation.md) | Draft | Order-sensitive `@annotation` handling for free-floating visual notes in microflows ||
5151
| [Page Syntax V2](PROPOSAL_page_syntax_v2.md) | Superseded | Page/widget syntax with `{}` blocks and `->` binding. Superseded by V3 (archived) ||
5252
| [Page Styling Support](page-styling-support.md) | Partial | CSS classes, inline styles, dynamic classes, design properties. Phase 1 (Class/Style) done ||
5353
| [Page Composition](proposal_page_composition.md) | Proposed | Fragment definitions and ALTER PAGE for partial page editing | Page Syntax V2, Page Styling |

mdl-examples/bug-tests/304-describer-empty-else-branch.mdl

Lines changed: 0 additions & 57 deletions
This file was deleted.

mdl-examples/bug-tests/306-describer-annotations-before-unsupported-comment.mdl

Lines changed: 0 additions & 61 deletions
This file was deleted.

mdl-examples/bug-tests/308-commit-on-error-rollback-roundtrip.mdl

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)