fix(flows): six silent wrong writes in flows — written correctly or refused (#591 #698 #991 #992 #870 #175) - #918
Merged
Merged
Conversation
…627) The fluent API's AttributeModifier.Apply() rebuilt the attribute with raw == nil and kept only its $ID, so the codec minted GUID = $ID - the mendixlabs#1119 data-loss class. The write guard refused it, leaving the API unusable on any Studio Pro-authored attribute. Carry the stored raw bytes and export level via carryStoredAttribute, now shared with the entity rewrite's carryAttributeIdentity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MoveEntity scanned only the plain associations of the source unit, so a cross-association created by an earlier move was invisible: moving its second endpoint left a ParentPointer naming an element absent from its unit and Studio Pro could not open the project. Handle the three shapes: convert back to a plain association when both endpoints share a module (raw transform, GUID carried), let an own cross-association travel with its FROM entity, and re-point a cross-association in another module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…endixlabs#849) Studio Pro does not reload the model from disk, so a write mxcli makes while the project is open is silently discarded by Studio Pro's next save. The writer now refuses any write that would reach storage while Studio Pro's <project>.mpr.lock is beside the .mpr (matched without regard to case, as Studio Pro lower-cases it). Reads and writes elided as no-ops are never refused; exec --force or MXCLI_ALLOW_STUDIO_PRO_OPEN=1 override. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its mappings and its commit option (#571) create published rest service wrote only the path's {name} placeholders as operation parameters, each a String: a query or body microflow parameter failed mx check with CE0350, an Integer {id} with CE6539. import mapping, export mapping and commit parsed and were thrown away. - Parameters are derived from the microflow as Studio Pro derives them (path name -> Path, object/list -> Body, HttpRequest/HttpResponse -> none, else Query), each with the microflow parameter's type, merged over the stored parameters so a header / renamed / described one survives. - Mappings and commit go AST -> model -> BSON and back; describe prints them and notes parameters MDL cannot state. An unknown commit option is refused by exec and check (MDL-REST03). - create or modify carries the restated operation's summary, documentation and object handling; the service rewrite carries the stored keys MDL cannot state (authentication, CORS, documentation). List markers as Studio Pro writes them. TestApp's Services.OrdersRestApi leaves the round-trip allowlist. Fixes mendixlabs#1206 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- mendixlabs#591: list activities and cast carry the flow flavour's error handling (Abort in a nanoflow, where "Rollback" was CE6035); create, commit, call nanoflow and call microflow in a nanoflow accept only a handler without rollback (measured), refused otherwise; check now reports the nanoflow rules exec's build enforces (MDL091) and the annotation rules. - mendixlabs#698: the MCP mapper writes errorHandlingType and refuses a custom handler / error-handler flow PED cannot express. - mendixlabs#991: @anchor and @Curve inside an error handler are applied; describe emits the handler body's layout annotations. - mendixlabs#992: `@anchor(true: (to: top))` parsed as a division; the paren value now wins, unusable @anchor parameters are refused (MDL092), and `@curve(true: …)` is refused on nanoflows too. - mendixlabs#870: lock/unlock name their workflow; `pause all` / `unpause all` is Studio Pro's "(Un)pause instances"; bare `all` is refused (MDL-WF17); describe no longer turns a Studio Pro lock into `all`. - mendixlabs#175: `call workflow … on error continue` refused (MDL076), MDL076 exec-enforced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Six flow statements that passed
checkandexecbut wrote something wrong. Each one is now written correctly, or refused at both check and exec. Every one was reproduced first on an ako/TestApp copy (Mendix 11.14.0).Fixes mendixlabs#591
Fixes mendixlabs#698
Fixes mendixlabs#991
Fixes mendixlabs#992
Fixes mendixlabs#870
Fixes mendixlabs#175
What changed
create list/add/remove/count/head/filter/sortin a nanoflow: CE6035 per activity.call nanoflow … on error continue: CE6035.checkpassed all of it.Abortin a nanoflow,Rollbackin a microflow. This matches what Studio Pro stores (130 nanoflow actions in TestApp are allAbort). The writer emits the value and the reader reads it back. In a nanoflow, create, commit, call nanoflow and call microflow accept onlyon error without rollback, measured per cell. Every other clause is refused there.ValidateNanoflownow reports the nanoflow rules that previously only exec's build enforced (MDL091), plus the annotation rules.--mcp, the call action's error handling was dropped.errorHandlingType. A custom handler, or an error-handler flow, is refused: PED'sSequenceFlowhas no error-handler property (checked withped_get_schema).@anchor/@curveinsideon error … begin … end errordid nothing.describeprinted no@position(or other layout) inside the handler.emitObjectAnnotations. The error edge's entry side is compared against the top side when deciding whether it is the default.@anchor(true: (to: top))was parsed asto ÷ top, so no anchor was set.@curve(true: …)was dropped silently on nanoflows.annotationParenValuebeforeannotationValue. An@anchorparameter mxcli cannot use is refused (MDL092). Nanoflows now run MDL059/060.lock workflow all→ CE1825.describeshowed Studio Pro's lock (PauseAllWorkflowsplus a selection, in WorkflowCommons) aslock workflow all;.lock workflow $Def|Mod.Wf [pause all]andunlock … [unpause all](Studio Pro's "Pause / Unpause instances"). The writer always writes the named selection. A bareallis refused (MDL-WF17).call workflow … on error continue→ CE6035.StatementErrorHandlingfalls back to reflection, so statements missing from the hand-kept list (call workflow, REST) are seen.Design choices
pause all/unpause allandlock workflow Mod.Wfare additions: before this PR they were parse errors (anddescribeemitted the qualified form, which did not parse).to:is the incoming edge, so on the first handler statement it is the error edge.from:and@curveapply to the outgoing edge. On the last statement that is the rejoin edge, which takes onlyfrom:.@curvestays unsupported. It is now refused on nanoflows too, matching microflows.Rollbackon list activities stay as they are until the flow is rebuilt.Test plan (what I ran)
go test ./mdl/executor/ ./mdl/visitor/ ./mdl/backend/... ./mdl/exprcheck/... ./cmd/mxcli/... ./mdl/linter/..., all green.Rollbackliteral → read backRollback.ehType→"".ValidateNanoflowadditions → no MDL091/060.TrueBranchAnchornot set.lock workflow all;.ON ERROR { }are accepted and silently ignored, anddescribeemits none of them — the error branch's layout is unwritable and lost on round-trip mendixlabs/mxcli#991 build/describe: these tests failed before their implementation.make test-integration-roundtrippasses.make test-integration-parityandmake test-integration-executoreach had tests that asserted the now-refused CE6035 forms (commit … on error rollbackin a nanoflow,commit … on error continue,call microflow … on error continuein a nanoflow). I moved those to measured-buildable forms and re-ran them green.make check-conformance,make lint,make check-findings,make build: all pass.checkrefuses every bad form.mdl 1): it builds with 0 errors. It covers nanoflow list ops and a handler with@anchor/@curve. It stores error-edge sides (2,3), handler edge (1,3) with curves0;30/0;-30, rejoin (0,2) with curves0;-30/-30;0, and the true edge (1,0). It also coverslock … pause allwith a name selection.create or modifyscript a second time reported "7 documents already in sync".describe→ exec of the result reported unchanged.WorkflowCommons.ACT_WorkflowDefinition_Lockand…_Unlock: "16 documents already in sync". Before this PR, the lock flows described aslock workflow all;.errorHandlingType. It follows theped_get_schemadeclaration, and the notify mapping already uses it.🤖 Generated with Claude Code