Just goto the Java action and select the enum you want to use. Then just commit this Java action. If you want to have it for multiple enums just copy the Java action and select the right enum for each copy. Then you can use this Java action:
Not sure how the CommunityCommons action works, but you can create your own very simple Java action to convert a string to enum.
Just create a new Java action with a string input parameter and the desired enum as output parameter. Next, deploy to eclipse, and open the java action in Eclipse (or any other editor), and simply return you input string:
I think you used it almost right, except
Did you noticed the following the Community commons class
// Replace LogLevel.class by the proxy class for your Enumeration
Optional<LogLevel> result = Misc.enumFromString(LogLevel.class, toConvert);
My take on this is
I have a generic implementation with me which returns the translation value given the language. But if we want to return ENUM, then specific implementation is still needed.
Im still looking at how the above action has to be used with example, will keep you posted when I got to know it.
https://medium.com/mendix/customizing-java-actions-mendix-25ec5cc14f24 will give you a good explanation on how to customize this EnumerationFromString JA the right way.
Make sure that when you replace communitycommons.proxies.LogLevel with modulefolder.proxies.enumname, that the modulefolder name is lowercase.
Excellent answers here! Thank you!