Machinist.event
You're seeing just the macro
event
, go back to Machinist module for more information.
Defines an event
block grouping a same-event from
-> to
transitions
event "form_submitted" do
from :form1, to: :form2
from :form2, to: :test
end
Defines an event
block grouping a same-event from
-> to
transitions
with a cond option that should receive a function that returns a new state.
event "update_score"", cond: &check_score/1 do
from :test, to: :approved
from :test, to: :reproved
end
defp check_score(%{score: score}) do
if score >= 70, do: :approved, else: :reproved
end