5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/super_state/common_states.rb', line 5
def self.included(klass)
klass.class_eval do
include SuperState
super_state :pending, :initial => true
super_state :processing
super_state :completed
super_state :failed
super_state_group :outstanding, ["pending", "processing"]
state_transition :start_processing, :pending => :processing
state_transition :complete_processing, :processing => :completed
state_transition :complete, :pending => :completed
state_transition :fail, :processing => :failed
state_transition :restart, :failed => :processing
end
end
|