1 class JobTask < ArvadosModel
4 include CommonApiTemplate
5 serialize :parameters, Hash
6 before_create :set_default_qsequence
7 after_update :delete_created_job_tasks_if_failed
9 api_accessible :user, extend: :common do |t|
11 t.add :created_by_job_task_uuid
24 def delete_created_job_tasks_if_failed
25 if self.success == false and self.success != self.success_was
26 JobTask.delete_all ['created_by_job_task_uuid = ?', self.uuid]
30 def set_default_qsequence
31 self.qsequence ||= self.class.connection.
32 select_value("SELECT nextval('job_tasks_qsequence_seq')")