fix #590: rewrite OData example Level 9.1 to use TripPin schema actions#592
fix #590: rewrite OData example Level 9.1 to use TripPin schema actions#592ako wants to merge 2 commits into
Conversation
AI Code ReviewWhat Looks Good
RecommendationApprove. The PR is a targeted fix that resolves the Studio Pro NRE issue in the example without modifying code or introducing new syntax. It maintains all educational value while using a functional OData service. Manual Studio Pro validation is pending but the changes are logically sound and address the root cause. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
The original Level 9.1 created a microflow `OdTest.ACT_CallExternalAction` that called `OdTest.SalesforceAPI.GetAccounts(...)` and `OdTest.SalesforceAPI.NotifyUpdate(...)`. SalesforceAPI's MetadataUrl is a placeholder that doesn't return $metadata, so the ConsumedODataService BSON is written with an empty `Metadata` cache. Studio Pro's project checker then resolves the Name fields against an empty schema, gets null, and the checker aborts with a NullReferenceException in `Mendix.Modeler.Integration.CallExternalAction.get_SchemaAction()` → `ExternalActionParameterMapping.get_SchemaParameter()`. The crash blocks all in-IDE error reporting, not just for this microflow. Move the microflow definition to a new Level 10.4.1, right after the TripPin client is created (Level 10.1) and its $metadata is actually cached. Use unbound TripPin entries `GetNearestAirport` (Function with lat/lon parameters and a Trippin.Airport return) and `ResetDataSource` (parameterless Action) so both the parameter-mapping and the `on error continue` variants are still demonstrated. The microflow stays in `OdTest` so `show external actions in OdTest` (Level 9.2) still returns a row. The existing drop in Level 8.8a already runs before Level 8.8c (TripPin client drop), so cleanup order is correct. Issue #590 separately documents the upstream Studio Pro robustness gap (`SchemaAction` should null-check instead of NREing) so it can be escalated to Mendix support. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ration pane NRE
`create or modify external entity` overwrites `RemoteEntityName` (BSON field
`RemoteName`) with the empty string when the `RemoteName` property is
omitted from the statement (see mxcli#594). Level 8.6c was relying on
preservation of the value set by 8.6a/8.6b, but the resulting BSON ended up
with `RemoteName: ""`. Studio Pro's Integration Pane visualiser then NREs
in `ODataRemoteEntitySource.get_RemoteId()` with
`ArgumentNullException("EntityTypeName")` because the C# property aliases
the BSON `RemoteName` field.
Repeat `RemoteName: 'Account'` in 8.6c. The underlying executor bug is
tracked separately in #594 and will be fixed in its own PR; this commit
keeps the example file usable today.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
154045f to
2f2465a
Compare
AI Code ReviewCritical Issues
Moderate Issues
Minor Issues
What Looks Good
RecommendationApprove. The PR correctly fixes the reported issue by replacing non-functional example actions with real, resolvable ones from a working OData service (TripPin), positioned correctly in the example sequence to ensure metadata availability. All automated checks pass, and the manual validation step is appropriately acknowledged. The changes are minimal, well-documented, and maintain the example's educational value while resolving the Studio Pro checker crash. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Summary
Fix two distinct Studio Pro crashes triggered by running
mdl-examples/doctype-tests/10-odata-examples.mdlagainst a project.Commit 1 — fixes #590 (
CallExternalAction.SchemaActionNRE in project checker):The
call external actiondemonstration in Level 9.1 referenced fictional actions onOdTest.SalesforceAPI. SalesforceAPI'sMetadataUrldoesn't resolve, so its cached$metadatais empty, and Studio Pro NREs trying to resolve the action name against the empty schema. The crash aborts the entire background checker, hiding all other problems.$metadatacached.GetNearestAirport(lat=…, lon=…)(Function, parameters + return) andResetDataSource()(Action, parameterless +on error continue) — both are unbound entries in TripPin's real schema, so Studio Pro resolves them correctly.OdTestsoshow external actions in OdTest(Level 9.2) still returns a row.Commit 2 — fixes #594 (
ODataRemoteEntitySource.RemoteIdNRE in Integration Pane):Level 8.6c was relying on
create or modify external entitypreserving theRemoteNamepreviously set by 8.6a/8.6b. The executor actually overwrites omitted properties with empty strings, so the resulting BSON hadRemoteName: "". Studio Pro's Integration Pane visualiser then NREs withArgumentNullException("EntityTypeName")because its C# property aliases the BSONRemoteNamefield.RemoteName: 'Account'explicitly in Level 8.6c.mdl/executor/cmd_odata.go) is tracked in create or modify external entity wipes omitted RemoteName/EntityTypeName (Studio Pro NRE in ODataRemoteEntitySource.RemoteId) #594 and will be fixed in its own PR.Why two fixes in one PR
Both are one-line example-file changes that unblock the same end-to-end validation (
run example → open in Studio Pro → checker + integration pane work). The underlying executor and Studio Pro robustness issues are tracked in separate issues (#594, plus #590 itself notes the upstream gap).Test plan
make build— passesmake test— passes (nothing in this PR touches Go code)./bin/mxcli check mdl-examples/doctype-tests/10-odata-examples.mdl→✓ Syntax OKCallExternalAction.SchemaActionODataRemoteEntitySource.RemoteId🤖 Generated with Claude Code