Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 82391

Get enumeration in Java

$
0
0

How can I retrieve an enumeration in Java, e.g. based on a string? Currently, I use the following code:

String enumName = "module.proxies.EnumerationName";
Class enumClass = Class.forName(enumName);
if (enumClass.isEnum()) {
  doSomething();
}

What I am looking for is some kind of neater, more Mendix like solution: e.g. for microflows, I can call Core.getMicroflowNames() and filter to find the microflow. Is there such a method for enumerations? Alternatively, a TypeParameter for a Java action of AnyEnumeration would work as well.

Edit

To be more specific: I want to have a Java action with two parameters:

  • AnyEnumeration (in the above code example, this is the string enumName)
  • String, microflow name

This Java action will then iterate over every member of the enumeration in AnyEnumeration and execute the microflow for each member.


Viewing all articles
Browse latest Browse all 82391

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>