Page 1 of 1

Initial state of state machine

PostPosted: Sat Nov 21, 2020 3:59 am

I try to simulate a state machine associated to a class.

My first problem is the following: I have an attribute named state in the class which is an enumeration, and i want to be matched with every state in the state machine. Currently I just gave the states in the state machine the same name, but is there a better/more correct way to do that?

My second problem is during execution of an activity which has an input type matching the same class i would like to start the state machine, but so that the initial state matches the state attribute of the instance. Like if the state attribute is SEND_NOTIFICATION i would like to start the machine from there. Is there a nice way to achieve that result?