@startuml

Participant MokedModule
Participant CallHandler1
Participant Fun1
Participant CallHandler2
Participant Fun2
Participant History

                [-> MokedModule         : call1(Args)
Activate            MokedModule
MokedModule      -> CallHandler1
Activate            CallHandler1
CallHandler1     -> Fun1
Deactivate          CallHandler1
Activate            Fun1

                [-> MokedModule         : call2(Args)
Activate            MokedModule
MokedModule      -> CallHandler2
Activate            CallHandler2
CallHandler2     -> Fun2
Deactivate          CallHandler2
Activate            Fun2
Fun2             -> Fun2                : eval_fun
Activate            Fun2
Fun2             -> Fun2                : R2
Deactivate          Fun2
Fun2             -> History             : add_call(Fun, Args, R2)
Activate            History
History         --> Fun2                : ok
Deactivate          History
Fun2            --> MokedModule         : R2
Deactivate          Fun2
               [<-- MokedModule
Deactivate          MokedModule

Fun1             -> Fun1                : eval_fun
Activate            Fun1
Fun1             -> History             : get_history()
Activate            History
Note left of History                    : In this schedule\nWe get the call to call2
History         --> Fun1                : History
Deactivate          History
Fun1             -> Fun1                : R1
Deactivate          Fun1
Fun1             -> History             : add_call(Fun, Args, R1)
Activate            History
History         --> Fun1                : ok
Deactivate          History
Fun1            --> MokedModule         : R1
Deactivate          Fun1
               [<-- MokedModule
Deactivate          MokedModule


                [-> History             : get_history()
Activate            History
               [<-- History             : History
Deactivate          History

@enduml
