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 editable_attributes
51 %w(name description components)
54 def attribute_editable?(name, ever=nil)
55 (ever or %w(New Ready).include?(state)) and super
58 def attributes_for_display
59 super.reject { |k,v| k == 'components' }
66 def component_input_title(component_name, input_name)
67 component = components[component_name]
68 return nil if component.nil?
69 param_info = component[:script_parameters].andand[input_name.to_sym]
70 if param_info.is_a?(Hash) and param_info[:title]
73 "\"#{input_name.to_s}\" parameter for #{component[:script]} script in #{component_name} component"
77 def textile_attributes