How to connect multiple ENUM options to a single IF statement?
I want to create a more readable and especially shorter IF statement with enumeration options. For now, as far as I know, this is the basic way to go: if $User/Status = UserStatus.Active or $User/Status = UserStatus.InActive or $User/Status = UserStatus.Disabled or $User/Status = UserStatus.Blocked then X else Y Whereas I'd assume this, for a single enumeration, would be much better if $User/Status = [ UserStatus.Active or UserStatus.InActive or UserStatus.Disabled or UserStatus.Blocked ] then X else Y Is there a way to do so? Or anything to shorten an enumeration IF query If the answer is no, then hereby my feature request :)
Wouldn't it be better (more readable) instead to use a split instead of an IF-statement? Like this:
Bonus: When you expand your enumeration, Mendix will automatically point to the missing enumeration exit in this microflow.
I would prefer:
if $User/Status in
[UserStatus.Active, UserStatus.InActive, UserStatus.Disabled, UserStatus.Blocked]
then maybe we can also have the same for lists:
if $User in $UserList
What is the gain you are aiming for? writing 10-20 chars less?
I would say...keep it like it is, seen the community is used to it and the gain of changing a syntax is less then getting used to a new, consequently structured syntax...and I think that the modeler would not interpret it diffirently.