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
Copy file name to clipboardExpand all lines: .claude/skills/mendix/write-microflows.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,6 +340,23 @@ end case;
340
340
341
341
`(empty)` represents an unset enumeration value. Multiple values can share one `when` branch by separating them with commas. Case values are bare identifiers — do **not** quote them.
342
342
343
+
### Type Split And Cast Statements
344
+
345
+
Use `split type` when a microflow branches on an object's runtime specialization.
346
+
Use `cast` inside a type branch to create the specialized variable used by the branch body.
347
+
348
+
```mdl
349
+
split type $Input
350
+
case Sample.SpecializedInput
351
+
cast $SpecificInput;
352
+
return true;
353
+
else
354
+
return false;
355
+
end split;
356
+
```
357
+
358
+
`case` values are qualified entity names. The optional `else` branch handles objects that do not match any listed specialization.
# Proposal: Microflow Inheritance Split And Cast Statements
2
+
3
+
Status: Draft
4
+
5
+
## Summary
6
+
7
+
Add round-trip MDL support for type-based microflow decisions and cast actions:
8
+
9
+
```mdl
10
+
split type $Input
11
+
case Sample.SpecializedInput
12
+
cast $SpecificInput;
13
+
else
14
+
return false;
15
+
end split;
16
+
```
17
+
18
+
## Motivation
19
+
20
+
Studio Pro represents specialization/type decisions as `InheritanceSplit` objects and stores downcasts as `CastAction` activities. Without first-class MDL statements, `describe` can only emit unsupported comments or incomplete split output, and `exec` cannot rebuild the same graph.
21
+
22
+
## Semantics
23
+
24
+
`split type $Var` evaluates the runtime specialization of an object variable. Each `case Module.Entity` branch corresponds to an outgoing sequence flow with an `InheritanceCase`. The optional `else` branch maps to the outgoing flow without an inheritance case.
25
+
26
+
`cast $Output` emits a `CastAction` that produces the downcast variable. `$Output = cast $Input` is accepted for source-preserving authoring, but current Mendix BSON stores the generated cast variable as the primary persisted field.
27
+
28
+
## Tests And Examples
29
+
30
+
`mdl-examples/doctype-tests/inheritance_split_statement.test.mdl` demonstrates the syntax. Go regression tests cover parser construction, builder output, describer output, validation recursion, and BSON writer support for inheritance case values and cast actions.
31
+
32
+
## Open Questions
33
+
34
+
- Should `exec` validate `case Module.Entity` against the project's specialization hierarchy when connected?
35
+
- Should the source-preserving `$Output = cast $Input` form round-trip both variable names once the underlying BSON fields are confirmed for all supported Mendix versions?
Copy file name to clipboardExpand all lines: docs/11-proposals/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ BSON schema Registry ◄──── multi-version Support
54
54
|[Microflow ENUM SPLIT Statement](PROPOSAL_microflow_enum_split_statement.md)| Implemented | Enumeration decision splits via `case $Var when Value then … end case;`| — |
0 commit comments