1 class PipelineInstance < ArvadosBase
2 attr_accessor :pipeline_template
4 def self.goes_in_projects?
9 pipeline_name = self.name
10 if pipeline_name.nil? or pipeline_name.empty?
11 template = PipelineTemplate.where(uuid: self.pipeline_template_uuid).first
24 PipelineTemplate.find(pipeline_template_uuid).name
30 def update_job_parameters(new_params)
31 self.components[:steps].each_with_index do |step, i|
32 step[:params].each do |param|
33 if new_params.has_key?(new_param_name = "#{i}/#{param[:name]}") or
34 new_params.has_key?(new_param_name = "#{step[:name]}/#{param[:name]}") or
35 new_params.has_key?(new_param_name = param[:name])
37 %w(hash data_locator).collect(&:to_sym).each do |ptype|
38 param_type = ptype if param.has_key? ptype
40 param[param_type] = new_params[new_param_name]
46 def attribute_editable? attr, *args
47 super && (attr.to_sym == :name || attr.to_sym == :description ||
48 (attr.to_sym == :components and
49 (self.state == 'New' || self.state == 'Ready')))
52 def attributes_for_display
53 super.reject { |k,v| k == 'components' }
60 def component_input_title(component_name, input_name)
61 component = components[component_name]
62 return nil if component.nil?
63 param_info = component[:script_parameters].andand[input_name.to_sym]
64 if param_info.is_a?(Hash) and param_info[:title]
67 "\"#{input_name.to_s}\" parameter for #{component[:script]} script in #{component_name} component"
71 def textile_attributes