I have "succeeded" and "failed" states that both represent "completed" states. The traditional way to represent that in a state transition diagram is with nested states: "succeeded" and "failed" nest under "completed". This might introduce the notion of multiple simultaneous states e.g. "failed"/"completed", "succeeded"/"completed".
The way I am handling this now is by explicitly modeling the compound state and synthesizing a predicate for it (completed?):
complete_states = [:succeeded, :failed]
state all - complete_states do
state *complete_states do
after_transition any => complete_states do
The predicate method pair is a bit not-DRY but perhaps worse is that my (graphviz) diagram doesn't nest "succeeded"/"failed" under "completed".
Am I doing this right or is there a better way with state_machine?