Can I use a switch to Map to an enumeration from imported string variables?
Hello, Newbie to Mendix here and I’m following the Crash course learning path. I’m Interacting with data and want to transform Import variables : String values are imported and transformed to my new enumeration (Gender and Jobtitle). In the course you transform the import variables with a Microflow using a simple decision: ($JobTitle = ‘Doctor’) Now I was wondering how this would work out in a real project where hospitals can have more than a 100 jobtitles (staff, management, external contractors,...). How would I implement that? Would I need to add a new decision in my microflow after each possible enumvalue check? Or can I do this more compact, like with a sort of switch where I can combine the checks in one decision? Ps: making a new rule with a ton of decisions with each their return value is not what I look for. But will be accepted if it’s the only possible way to go.
It is possible to use an if/else statement in your decision. However for debugging and readibility reasons, it would be best to model it out fully with a check for every value.
For reasonable sized enumerations Lennart's right. For maintainabillity purposes etc.