Class: Task Deprecated
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Task
- Defined in:
- app/models/task.rb
Overview
Task form a large number of legacy pipelines in Sequencescape, however most
A large number of tasks delegate a large portion of their behaviour back to the
A Task forms part of a Workflow which in turn describes the steps that form a Pipeline. Most tasks are a subclass of Task
more recent pipelines exist outside of Sequencescape itself.
Tasks have three key methods #render_task: Which handles rendering the form displayed to the user #do_task: Which takes the parameters from the form, and performs the task in question #partial: Inicates which partial to render when displaying the form.
WorkflowsController. This behaviour is mostly defined in modules under Task.
Direct Known Subclasses
AddSpikedInControlTask, AssignTagsTask, AssignTagsToTubesTask, AssignTubesToMultiplexedWellsTask, BindingKitBarcodeTask, CherrypickTask, MovieLengthTask, MultiplexedCherrypickingTask, PlateTemplateTask, PlateTransferTask, PrepKitBarcodeTask, SamplePrepQcTask, SetDescriptorsTask, TagGroupsTask, ValidateSampleSheetTask
Instance Method Summary collapse
-
#can_link_directly?(batch) ⇒ Array<Bool,String>
Indicates if a task can be linked to directly from the batch show page For most tasks this dependent on whether the task can be performed, but some tasks are dependent on the previous task, or are even directly coupled to it.
-
#can_process?(batch) ⇒ Array<Bool,String>
Indicates if a task can be performed.
- #do_task(_workflows_controller, _params, _user) ⇒ Object
- #included_for_do_task ⇒ Object
- #included_for_render_task ⇒ Object
- #partial ⇒ Object
- #render_task(workflows_controller, params, _user) ⇒ Object
Methods inherited from ApplicationRecord
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Instance Method Details
#can_link_directly?(batch) ⇒ Array<Bool,String>
Indicates if a task can be linked to directly from the batch show page For most tasks this dependent on whether the task can be performed, but some tasks are dependent on the previous task, or are even directly coupled to it.
47 48 49 |
# File 'app/models/task.rb', line 47 def can_link_directly?(batch) can_process?(batch) end |
#can_process?(batch) ⇒ Array<Bool,String>
Indicates if a task can be performed. By default, most tasks will only support unreleased batches
33 34 35 |
# File 'app/models/task.rb', line 33 def can_process?(batch) batch.released? ? [false, 'Disabled on released batches'] : [true, nil] end |
#do_task(_workflows_controller, _params, _user) ⇒ Object
63 64 65 |
# File 'app/models/task.rb', line 63 def do_task(_workflows_controller, _params, _user) raise NotImplementedError, "Please Implement a do_task for #{self.class.name}" end |
#included_for_do_task ⇒ Object
51 52 53 |
# File 'app/models/task.rb', line 51 def included_for_do_task %i[requests pipeline lab_events] end |
#included_for_render_task ⇒ Object
55 56 57 |
# File 'app/models/task.rb', line 55 def included_for_render_task %i[requests pipeline lab_events] end |
#partial ⇒ Object
21 22 |
# File 'app/models/task.rb', line 21 def partial end |
#render_task(workflows_controller, params, _user) ⇒ Object
59 60 61 |
# File 'app/models/task.rb', line 59 def render_task(workflows_controller, params, _user) workflows_controller.render_task(self, params) end |