Skip to content

CREATE JAVA ACTION cannot create Enumeration parameter — serialized as entity ref, build fails ('selected entity no longer exists') #680

Description

@Chendodelangen

Summary

CREATE JAVA ACTION cannot create a parameter of an Enumeration type. Both the ENUM Module.Enum and the Enumeration(Module.Enum) syntaxes serialize the parameter as an Object / entity-reference parameter pointing at the enumeration's qualified name as if it were an entity. mxcli check and mxcli exec both succeed, but the resulting model is invalid: mxbuild (and Studio Pro) reject it because the referenced "entity" does not exist (the name is an enumeration, not an entity).

This forces a workaround of either adding the enum parameter manually in Studio Pro, or dropping the parameter and hard-coding the value in the Java body.

mxcli version

mxcli version v0.13.0 (2026-06-20T10:38:49Z)

Mendix version

10.24.21.108016

Steps to reproduce

Given any enumeration (here the marketplace Barcode.BarcodeFormat):

CREATE JAVA ACTION AssetManagement.GenerateBarcodeWithLogo(
  "text": String NOT NULL,
  "format": Enumeration(Barcode.BarcodeFormat) NOT NULL,
  "width": Integer NOT NULL,
  "height": Integer NOT NULL,
  "destination": System.Image NOT NULL
)
AS $$
return true;
$$;

(The ENUM Barcode.BarcodeFormat syntax behaves identically.)

  1. ./mxcli check script.mdl -p App.mpr --referencespasses
  2. ./mxcli exec script.mdl -p App.mprsucceeds ("Created java action: ...")
  3. Build the project (mxbuild --target=deploy App.mpr, or open in Studio Pro).

Expected behaviour

The format parameter is created as a Java action parameter of type Enumeration, value type Barcode.BarcodeFormat (the same shape Studio Pro produces, generating barcode.proxies.BarcodeFormat format in the action stub). The project builds.

Actual behaviour

The parameter is serialized as an entity/object parameter. The generated mxcli stub shows it as a raw IMendixObject, and the build fails with:

ERROR at AssetManagement, Java action 'GenerateBarcodeWithLogo',
Property 'Entity' of Java action parameter 'format':
The selected entity 'Barcode.BarcodeFormat' no longer exists.

So the parameter's Entity property was populated with an enumeration's qualified name. mxcli check/exec do not detect this — only the downstream build does.

Notes / related

Diagnostic bundle

Available: mxcli-diag-20260622-132344.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions