1 class PipelineInvocation < ActiveRecord::Base
3 serialize :components, Hash
4 belongs_to :pipeline, :foreign_key => :pipeline_uuid, :primary_key => :uuid
6 before_validation :bootstrap_components
7 before_validation :update_success
13 components['steps'].collect do |step|
15 row = [nrow, step['name']]
16 if step['output_data_locator']
21 row << (step['warehousejob']['id'] rescue nil)
22 row << (step['warehousejob']['revision'] rescue nil)
23 row << step['output_data_locator']
24 row << (Time.parse(step['warehousejob']['finishtime']) rescue nil)
34 return 0 if t.size < 1
35 t.collect { |r| r[2] }.inject(0.0) { |sum,a| sum += a } / t.size
39 def bootstrap_components
40 if pipeline and (!components or components.empty?)
41 self.components = pipeline.components
46 if components and progress_ratio == 1.0