KStateMachine / kstatemachine

KStateMachine is a Kotlin DSL library for creating state machines and statecharts.
https://kstatemachine.github.io/kstatemachine/
Boost Software License 1.0
340 stars 19 forks source link

Wrong condition in transition is hard to maintain #1

Closed nsk90 closed 3 years ago

nsk90 commented 3 years ago

State may contain many transitions. Condition lambda helps to choose correct one. But is easy to make a mistake and have multiple transitions for current event, which is wrong.

Make a State to choose next state may be a better solution. As it should be simpler to make a decision where to go in one place, rather than in may separated lambdas.

nsk90 commented 3 years ago

solved with adding condtional transitions.