Method: Burstflow::Workflow#failed!

Defined in:
lib/burstflow/workflow.rb

#failed!Object



165
166
167
168
169
170
171
172
173
# File 'lib/burstflow/workflow.rb', line 165

def failed!
  run_callbacks :failure do
    raise InternalError.new(self, "Can't fail: workflow already failed") if failed?
    raise InternalError.new(self, "Can't fail: workflow already finished") if finished?
    raise InternalError.new(self, "Can't fail: workflow in not runnig") if !(running? || suspended?)
    self.status = FAILED
    save!
  end
end