Class: Pipeline

Inherits:
ApplicationRecord show all
Includes:
BatchValidation, SharedBehaviour::Named, Uuid::Uuidable
Defined in:
app/models/pipeline.rb

Defined Under Namespace

Modules: BatchValidation, GroupByParent, InboxExtensions, InboxGroupedBySubmission, RequestsInStorage Classes: GrouperForPipeline

Constant Summary collapse

ALWAYS_SHOW_RELEASE_ACTIONS =

Override this in subclasses if you want to display action links for released batches

false

Instance Method Summary collapse

Methods included from SharedBehaviour::Named

included

Methods included from BatchValidation

#validation_of_batch, #validation_of_batch_for_completion

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#all_requests_from_submissions_selected?(_request_ids) ⇒ Boolean

Returns:

  • (Boolean)

136
137
138
# File 'app/models/pipeline.rb', line 136

def all_requests_from_submissions_selected?(_request_ids)
  true
end

#allow_tag_collision_on_tagging_task?Boolean

Returns:

  • (Boolean)

144
145
146
# File 'app/models/pipeline.rb', line 144

def allow_tag_collision_on_tagging_task?
  true
end

#completed_request_as_part_of_release_batch(request) ⇒ Object


103
104
105
106
107
108
109
110
111
112
# File 'app/models/pipeline.rb', line 103

def completed_request_as_part_of_release_batch(request)
  if library_creation?
    unless request.failed?
      EventSender.send_pass_event(request.id, '', "Passed #{name}.", id)
      EventSender.send_request_update(request.id, 'complete', "Completed pipeline: #{name}")
    end
  else
    EventSender.send_request_update(request.id, 'complete', "Completed pipeline: #{name}")
  end
end

#detach_request_from_batch(batch, request) ⇒ Object

This is the old behaviour for every other pipeline.


81
82
83
84
85
# File 'app/models/pipeline.rb', line 81

def detach_request_from_batch(batch, request)
  request.return_for_inbox!
  update_detached_request(batch, request)
  request.save!
end

#extract_requests_from_input_params(params) ⇒ Object


126
127
128
129
130
131
132
133
134
# File 'app/models/pipeline.rb', line 126

def extract_requests_from_input_params(params)
  if (request_ids = params['request']).present?
    requests.inputs(true).order(:id).find(selected_keys_from(request_ids))
  elsif (selected_groups = params['request_group']).present?
    grouping_parser.all(selected_keys_from(selected_groups))
  else
    raise StandardError, 'Unknown manner in which to extract requests!'
  end
end

#has_controls?Boolean

Returns:

  • (Boolean)

122
123
124
# File 'app/models/pipeline.rb', line 122

def has_controls?
  controls.empty? ? false : true
end

#input_labware(_requests) ⇒ Object

Overridden in group-by parent pipelines to display input plates


91
92
93
# File 'app/models/pipeline.rb', line 91

def input_labware(_requests)
  []
end

#is_read_length_consistent_for_batch?(_batch) ⇒ Boolean

Returns:

  • (Boolean)

76
77
78
# File 'app/models/pipeline.rb', line 76

def is_read_length_consistent_for_batch?(_batch)
  true
end

#on_start_batch(batch, user) ⇒ Object


114
115
116
# File 'app/models/pipeline.rb', line 114

def on_start_batch(batch, user)
  # Do nothing
end

#output_labware(_requests) ⇒ Object

Overridden in group-by parent pipelines to display output


96
97
98
# File 'app/models/pipeline.rb', line 96

def output_labware(_requests)
  []
end

#post_finish_batch(batch, user) ⇒ Object


100
101
# File 'app/models/pipeline.rb', line 100

def post_finish_batch(batch, user)
end

#post_release_batch(batch, user) ⇒ Object


118
119
120
# File 'app/models/pipeline.rb', line 118

def post_release_batch(batch, user)
  # Do Nothing
end

#request_actionsObject


140
141
142
# File 'app/models/pipeline.rb', line 140

def request_actions
  [:fail]
end

#request_types_including_controlsObject


72
73
74
# File 'app/models/pipeline.rb', line 72

def request_types_including_controls
  [control_request_type].compact + request_types
end

#robot_verified!(batch) ⇒ Object


148
149
150
# File 'app/models/pipeline.rb', line 148

def robot_verified!(batch)
  # Do nothing!
end

#update_detached_request(_batch, request) ⇒ Object


87
88
# File 'app/models/pipeline.rb', line 87

def update_detached_request(_batch, request)
end