Skip to content

Commit faee336

Browse files
hjothamendixclaude
andcommitted
fixup: add bug-test 521 and CE0126 symptom row to fix-issue skill
Address PR #521 round-3 review (ako 2026-05-07). - **`mdl-examples/bug-tests/521-empty-java-action-typed-arg.mdl`** — new bug-test calling a Java action with a list parameter and a string parameter, both bound to MDL `empty`. Before the fix this trips CE0126 "Missing value for parameter X"; after the fix, both slots serialise as `Argument: "empty"` and `mx check` reports 0 errors. - **`.claude/skills/fix-issue.md`** — new symptom row mapping CE0126 on `call java action ... ($Param = empty)` to `addCallJavaActionAction` and the `resolvedBasicParams` fix pattern. Future contributors hitting the same symptom can land on the right file from the table without re-deriving the diagnosis. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e6298e1 commit faee336

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

.claude/skills/fix-issue.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ to the symptom table below, so the next similar issue costs fewer reads.
2727
| MDL check gives "unexpected token" on valid-looking syntax | Grammar missing rule or token | `mdl/grammar/MDLParser.g4` + `MDLLexer.g4` | Add rule/token, run `make grammar` |
2828
| CE7054 "parameters updated" / CE7067 "does not support body entity" after `send rest request` | `addSendRestRequestAction` emitted wrong BSON: all params as query params, BodyVariable set for JSON bodies | `mdl/executor/cmd_microflows_builder_calls.go``addSendRestRequestAction` | Look up operation via `fb.restServices`; route path/query params with `buildRestParameterMappings`; suppress BodyVariable for JSON/TEMPLATE/FILE via `shouldSetBodyVariable` |
2929
| `CREATE X` returns "already exists — use create or replace to overwrite" but OR REPLACE is not valid for that type | Error message in executor points to wrong keyword | `mdl/executor/cmd_<type>_*.go` — find the `NewAlreadyExistsMsg` call | Change hint from `or replace` to `or modify`; verify the AST stmt uses `CreateOrModify` not `CreateOrReplace` |
30+
| `mx check` CE0126 "Missing value for parameter X" on `call java action ... ($Param = empty)` for typed (non-entity, non-microflow) parameters | Builder emitted `BasicCodeActionParameterValue.Argument: ""` instead of the literal `"empty"` keyword | `mdl/executor/cmd_microflows_builder_calls.go``addCallJavaActionAction` | Capture all resolved BasicParameterType params into `resolvedBasicParams`; when bound to MDL `empty`, emit `Argument: "empty"` so Studio Pro recognises an explicit empty literal rather than treating the slot as missing |
3031

3132
---
3233

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
-- ============================================================================
2+
-- Bug #521: `empty` literal on a typed Java action parameter triggers CE0126
3+
-- ============================================================================
4+
--
5+
-- Symptom (before fix):
6+
-- `mx check` reports CE0126 "Missing value for parameter X" on a
7+
-- `call java action Module.Foo(Param = empty)` when Param is a typed
8+
-- (non-entity, non-microflow) parameter — most commonly a list parameter
9+
-- or a String parameter. The builder emitted a BasicCodeActionParameterValue
10+
-- with `Argument: ""` instead of the literal `"empty"` keyword Studio Pro
11+
-- uses to mark an explicit empty literal. Studio Pro treats the empty
12+
-- string as a missing slot and fires CE0126 on validation.
13+
--
14+
-- After fix:
15+
-- When the backend resolves the Java action and the parameter is a
16+
-- BasicParameterType (StringType, ListType, ParameterizedEntityType, etc.),
17+
-- the builder emits `Argument: "empty"` for an MDL `empty` literal so
18+
-- Studio Pro reads the slot as an explicitly-empty value, not a missing
19+
-- one. Entity-typed parameters keep using EntityCodeActionParameterValue
20+
-- and microflow-typed parameters keep using MicroflowParameterValue, so
21+
-- this fix is scoped to BasicParameterType alone.
22+
--
23+
-- Validation:
24+
-- `mxcli check 521-empty-java-action-typed-arg.mdl` parses the script.
25+
-- `mx check` against the resulting MPR reports 0 errors for both the
26+
-- list-typed and string-typed `empty` arguments. Roundtrip preserves
27+
-- the `Argument: "empty"` BSON value byte-for-byte.
28+
--
29+
-- Usage:
30+
-- mxcli exec mdl-examples/bug-tests/521-empty-java-action-typed-arg.mdl -p app.mpr
31+
-- mxcli -p app.mpr -c "describe microflow BugTest521.MF_CallWithEmpty"
32+
-- ============================================================================
33+
34+
create module BugTest521;
35+
36+
create non-persistent entity BugTest521.Item (
37+
Code : string
38+
);
39+
/
40+
41+
-- Java action with a list parameter and a string parameter — both typed
42+
-- (BasicParameterType) so they exercise the resolved-basic-arg path.
43+
create java action BugTest521.JA_ProcessBatch(Items: list of BugTest521.Item not null, Tag: string not null) returns boolean
44+
as $$
45+
return true;
46+
$$;
47+
/
48+
49+
-- Calling with `empty` for both typed slots must produce
50+
-- BasicCodeActionParameterValue.Argument = "empty" so Studio Pro
51+
-- recognises the explicit empty literal and does not fire CE0126.
52+
create microflow BugTest521.MF_CallWithEmpty ()
53+
returns boolean
54+
begin
55+
$Result = call java action BugTest521.JA_ProcessBatch(
56+
Items = empty,
57+
Tag = empty)
58+
on error rollback;
59+
return $Result;
60+
end;
61+
/

0 commit comments

Comments
 (0)