Statecharts: Limit the number of time a state gets executed
问题 How can I graphically represent within Statechart Diagrams that a state never gets executed more than a certain amount of times? So that it doesn't end in an infinite loop. Something like assert enterPIN(int p) <= 3 and then branch to another state, if condition violated. Should I include it somehow in the guard? Or in the state activities? EDIT: (CheckPIN)--[invalid]-->(counter| + inc.)--[counter>3]-->(retainCard) ^ | |-----[counter<=3]-----| Something in this direction? Legend: (StateName |