-
If an
@@ -1288,7 +1333,9 @@ handle_event(_, _, State, Data) ->
CallbackMode =
- callback_mode()
+ callback_mode() |
+ [ callback_mode()
+ | state_entry_events ]
@@ -1313,12 +1360,35 @@ handle_event(_, _, State, Data) ->
Module:code_change/4
returns.
+
+ The CallbackMode is either just
+ callback_mode()
+ or a list containing
+ callback_mode()
+ and possibly the atom
+ state_entry_events.
+
+
+ If the atom state_entry_events is present in the list,
+ the gen_statem engine will, at every state change,
+ insert an event of type
+ enter
+ with content OldState. This event will be inserted
+ before all other events such as those generated by
+ action()
+ next_event.
+
+
+ No state entry event will be inserted after a
+ Module:code_change/4
+ since transforming the state to a newer version is regarded
+ as staying in the same state even if the newer version state
+ should have a different name.
+
- If this function's body does not consist of solely one of two
- possible
- atoms
- the callback module is doing something strange.
+ If this function's body does not return an inline constant
+ value the callback module is doing something strange.