[[statemachine-faq]]
= FAQ
This chapter tries to give solutions to question user is most likely
to ask.

== State Changes

.I want to transit to next state automatically

{zwsp} +

There are few choices a state machine developer can choose.

* Implement an action and send appropriate event into a state machine
  which triggers a transition into a proper target state.
* Define deferred event within a state and before sending an event
  send an event which will be deferred and thus causing next
  appropriate state transition when it is more convenient to handle
  that event.
* Implement a triggerless transition which will automatically cause
  state transition into a next state when state has entry and its
  actions has been completed.

== Extended State

.How I can initialise variables on state machine start

{zwsp} +

Important concept in a state machine is that nothing really happens
unless there is a trigger which is causing a state transition which
then can fire actions. However, having said that, Spring Statemachine
always have an initial transition when state machine is started. With
this initial transition user can execute a simple action which within
a _StateContext_ can do whatever it likes with an extended state
variables.

