1 class PipelineInstance < ArvadosBase
2 attr_accessor :pipeline_template
4 def self.goes_in_projects?
10 PipelineTemplate.find(pipeline_template_uuid).name
16 def update_job_parameters(new_params)
17 self.components[:steps].each_with_index do |step, i|
18 step[:params].each do |param|
19 if new_params.has_key?(new_param_name = "#{i}/#{param[:name]}") or
20 new_params.has_key?(new_param_name = "#{step[:name]}/#{param[:name]}") or
21 new_params.has_key?(new_param_name = param[:name])
23 %w(hash data_locator).collect(&:to_sym).each do |ptype|
24 param_type = ptype if param.has_key? ptype
26 param[param_type] = new_params[new_param_name]
32 def attribute_editable? attr, *args
33 super && (attr.to_sym == :name ||
34 (attr.to_sym == :components and
35 (self.state == 'New' || self.state == 'Ready')))
38 def attributes_for_display
39 super.reject { |k,v| k == 'components' }
46 def component_input_title(component_name, input_name)
47 component = components[component_name]
48 return nil if component.nil?
49 param_info = component[:script_parameters].andand[input_name.to_sym]
50 if param_info.is_a?(Hash) and param_info[:title]
53 "\"#{input_name.to_s}\" parameter for #{component[:script]} script in #{component_name} component"