Closed mits87 closed 6 years ago
Hi, thanks for using the library.
Terminal state is not different from any other state therefore you should be able to use standard callbacks:
state_machine.on_enter :failed do |event|
...
end
Currently the terminal
allows to specify only a single terminal state. Expanding this to include more than one terminal state is a good idea.
Thank you for your answer.
It would be great if the terminal
could take more states than one.
PS. Is it possible do something like this:
state_machine.on_enter(:failed, :finished) do |event|
...
end
?
Because I didn't find anywhere this case.
I agree it would be great. Currently there are few quite important issues to address first.
The callbacks currently work with single state names due to dynamic method definitions. However, the underlying code accepts any number of arguments so I would just test if your callback gets fired for two different states.
Unfortunately I'm without internet now and my provider is less than helpful restoring it so may be unavailable for couple days.
This was actually always implemented, the terminal
expects comma delimited symbols:
terminal :failed, :finished
I've updated docs to explain multiple terminal states.
Hi,
I have a little problem because I would like read terminated state but I can't If:
terminal [:failed, :finished]
Thanks Peter