CASE statement in Mendix

0
How do I write the following C# SWITCH / CASE statement in the Mendix Modeler?   var variable = "test"; var counter = 0; switch (variable) { case "test": counter++; break; case "testtest": counter--; break; default: break; }   I understand that I can nest a series of exclusive splits but I have always found SWITCH / CASE to be much more readable and would like to reuse it in Mendix if possible.
asked
1 answers
1

If your variable is an enum you can use 1 exclusive split (the orange one) and adjust a variable Counter  and do a $Counter+1 or $Counter-1

the empty enum value is your default then.

If you want more generic case statements you can create a custom Java Action with type parameters

answered