1 class PipelineInstance < ArvadosBase
2 attr_accessor :pipeline_template
4 def self.goes_in_projects?
8 def friendly_link_name lookup=nil
9 pipeline_name = self.name
10 if pipeline_name.nil? or pipeline_name.empty?
11 template = if lookup and lookup[self.pipeline_template_uuid]
12 lookup[self.pipeline_template_uuid]
14 PipelineTemplate.where(uuid: self.pipeline_template_uuid).first
28 PipelineTemplate.find(pipeline_template_uuid).name
34 def update_job_parameters(new_params)
35 self.components[:steps].each_with_index do |step, i|
36 step[:params].each do |param|
37 if new_params.has_key?(new_param_name = "#{i}/#{param[:name]}") or
38 new_params.has_key?(new_param_name = "#{step[:name]}/#{param[:name]}") or
39 new_params.has_key?(new_param_name = param[:name])
41 %w(hash data_locator).collect(&:to_sym).each do |ptype|
42 param_type = ptype if param.has_key? ptype
44 param[param_type] = new_params[new_param_name]
50 def attribute_editable? attr, *args
51 super && (attr.to_sym == :name || attr.to_sym == :description ||
52 (attr.to_sym == :components and
53 (self.state == 'New' || self.state == 'Ready')))
56 def attributes_for_display
57 super.reject { |k,v| k == 'components' }
64 def component_input_title(component_name, input_name)
65 component = components[component_name]
66 return nil if component.nil?
67 param_info = component[:script_parameters].andand[input_name.to_sym]
68 if param_info.is_a?(Hash) and param_info[:title]
71 "\"#{input_name.to_s}\" parameter for #{component[:script]} script in #{component_name} component"
75 def textile_attributes