{ edge(MyEvent.PressRental, next = MyState.Lock) } state(MyState.OnLoan, entry = { println("turnOnRentalLed") }, exit = { println("turnOffRentalLed") }) { state(MyState.Lock) { edge(MyEvent.PressReturn, next = MyState.NotLoaned) edge(MyEvent.PressUnLock, next = MyState.UnLock) } state(MyState.UnLock) { edge(MyEvent.PressLock, next = MyState.Lock) } } }