Bug
SET $obj/Module.Assoc = $other inside a microflow body fails validation with:
variable 'obj/Module.Assoc' is not declared
The in-CREATE form works fine:
create object $obj of MyModule.Order (
MyModule.Order_Customer = $customer
);
Root cause
The grammar and parser both support association paths as SET targets (attributePath rule in MDLParser.g4). The parser captures the full path string obj/Module.Assoc into MfSetStmt.Target.
The failure is in isVariableDeclared (mdl/executor/cmd_microflows_builder.go), which does a direct map lookup using the full path string. Only the bare variable name obj is registered in varTypes. The function does not extract the variable prefix before looking up.
The fix: strip the path suffix (everything from the first / or .) before doing the map lookup in isVariableDeclared.
Reproduction
create microflow MyModule.ACT_LinkCustomer (
$order: MyModule.Order,
$customer: MyModule.Customer
)
begin
-- This fails:
set $order/MyModule.Order_Customer = $customer;
return;
end;
Affected files
mdl/executor/cmd_microflows_builder.go — isVariableDeclared function
mdl/executor/cmd_microflows_builder_actions.go — call site (addChangeVariableAction)
Related
Also add a doctype test or bug test in mdl-examples/bug-tests/ covering this case so it doesn't regress.
Bug
SET $obj/Module.Assoc = $otherinside a microflow body fails validation with:The in-CREATE form works fine:
Root cause
The grammar and parser both support association paths as SET targets (
attributePathrule inMDLParser.g4). The parser captures the full path stringobj/Module.AssocintoMfSetStmt.Target.The failure is in
isVariableDeclared(mdl/executor/cmd_microflows_builder.go), which does a direct map lookup using the full path string. Only the bare variable nameobjis registered invarTypes. The function does not extract the variable prefix before looking up.The fix: strip the path suffix (everything from the first
/or.) before doing the map lookup inisVariableDeclared.Reproduction
Affected files
mdl/executor/cmd_microflows_builder.go—isVariableDeclaredfunctionmdl/executor/cmd_microflows_builder_actions.go— call site (addChangeVariableAction)Related
Also add a doctype test or bug test in
mdl-examples/bug-tests/covering this case so it doesn't regress.