fix: infer java action result variable types#357
Open
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Open
fix: infer java action result variable types#357hjotha wants to merge 2 commits intomendixlabs:mainfrom
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Conversation
Symptom: after rebuilding a Java action call, downstream statements could treat the result variable as unknown even when the Java action definition exposes a concrete return type such as FileDocument, Entity, or List. Root cause: addCallJavaActionAction built the action and parameter mappings but did not register the output variable type from the Java action metadata. Generic list-return actions also lost the list entity type available from their input list argument. Fix: register concrete Java action return types on the flow builder and infer an entity list type for generic list-return actions from the first list-typed input argument. Tests: add synthetic builder regressions for FileDocument returns, concrete list returns, and generic list returns that inherit the input list type.
This was referenced Apr 27, 2026
Adds an MDL script under mdl-examples/bug-tests/ exercising a Java action with an entity return type and a downstream `change` on the result variable. After exec, `mx check` reports 0 errors, confirming the result variable's type is inferred from the Java action signature so dependent activities resolve. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Closes part of #352.
Part of #332.
Summary
This extracts the Java action result-type inference fix from the audit staging branch.
The builder already looks up Java action definitions to format entity-typed parameters, but it did not register the output variable type from the Java action return metadata. Downstream statements could therefore see Java action outputs as unknown even when the action returns a concrete entity/list/file type.
Changes
System.FileDocumentfor Java actions returningFileDocument.Validation
make buildmake lint-gomake test