Method: AASMExport#print_warning

Defined in:
lib/lucidMachines/aasm_export.rb


132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/lucidMachines/aasm_export.rb', line 132

def print_warning(event, from_states, to_state)

  if(event.size != 1)
    puts "Warning: Transition without any event !" if event.size == 0

    if event.size > 1
      puts "Warning: Transition with multiple events !"
      event.each do |e|
        puts " - Event: " + e.to_s
      end
    end
  end
  
  if(to_state != 1)
    puts "Warning: Transition without output !" if to_state.size == 0
    puts "Warning: Transition with multiple outputs !" if to_state.size > 1
  end
  
  if(from_states.size < 1)
    puts "Warning: Transition without input !" if from_states.size == 0
  end
end