I have a property that will be a number between 1 and 7 (it’s not random). What I’d like is to create a trigger that executes a different command depending on the number. If the property is 1, it executes command 1, if it’s 2, it executes command 2, etc.
Is there a way to do this short of creating 8 triggers? It seems like the only option is a START trigger that fires a command, and then 7 other triggers that respond to this command, each looking for a different property number.
It would be nice if I could do this without 8 triggers, as this would significantly cut down on the visual clutter in my trait window and make it easier to debug and change it.
Not really. You are asking for a Switch / Case statement, which is generally agreed would be a very useful feature but it has not made it into reality so far. @Brent_Easton mentioned implementation challenges in this thread. Perhaps it will happen one day, meanwhile I generally do what you are thinking of.
One of the big advantages of a Case statement would be avoiding the problem of a later trigger mis-firing because the earlier one changed the conditions. So, I have sometimes found it best to evaluate the condition (case) into a property at the start and then activate the chain of triggers, only one of which will activate based on the case property.