Erlang: Gen_fsm code change without stopping the system

Could someone help me in this doubt?

From what I read in the erlang appup cookbook documentation I can’t replace the module (gen_XXX) and HOT SWAP the code.
I’m sketching a system, so I decided to make small test pieces and then start developing. How can I make a modification to mod4_fsm which is a behavior(gen-fsm) and replace mod4_fsm without rebooting the system? below I put the test design.
In mod4_fsm I inserted the callback change_code {Oldvsn, … }, for the changes to be recognized, the problem is that I don’t want to generate a release, I want to get the mod4_fsm.erl compile and put the mod4_fsm.beam in the directory and the erlang recognize the change.

mod1.erl
|
V
Mod1_app
|
V
mod2_sup_sup
|
V
mod3_sup
|
V
Mod4_fsm

Mod1.appup

{“1.1.2”,
[{<<“1\…">>, [{restart_application, mod1}]}],
[{<<"1\…
”>>, [{restart_application, mod1}]}],

Mod1.app

{application, Mod1,
[{description, “My test”},
{vsn, “1.1.2”},
{modules,
[
mod1,
mod1_app,
mod2_sup_sup,
mod3_sup,
mod4_fsm]},
{registered, [mod1]},
{applications, [kernel, stdlib, sasl]},
{mod, {Mod1_app, []}}]}.Please add two tags to your thread (one of which can simply be erlang)

Thanks :slight_smile: