I get an error when I include the change_callback_module action as a result of get_statem:init/1. If I understand the documentation correctly, this action would be allowed at init/1, or not?
Point is, at the end of get_statem:init/1, I know which callback module is relevant and I want to make the switch to that callback module at that time
The error message I get is: error:{bad_action_from_state_function, {change_callback_module, ....
Use state_enter callback mode and change the callback module in the next state’s enter clause. Use EventContentType as null to only match on the transition from init/1.
Thanks, I’ll do that, however first I’ll have to upgrade from 22 to something more recent since gen_statem doesn’t support change_callback_module in that version. Since the documentation doesn’t mention the minimal version for this action, I was assuming it was in.
I did upgrade to 25.3 and now change_callback_module works as expected from init/1.