Method: SpotFlow::Execution#end

Defined in:
lib/spot_flow/execution.rb

#end(notify_parent = false) ⇒ Object



118
119
120
121
122
123
124
125
126
127
# File 'lib/spot_flow/execution.rb', line 118

def end(notify_parent = false)
  @status = "completed" unless status == "terminated"
  map_output_variables if step&.output_mappings&.present?
  parent.variables.merge!(variables) if parent && variables.present?
  @ended_at = Time.zone.now
  context.notify_listener(:execution_ended, execution: self)
  children.each { |child| child.terminate unless child.ended? }
  parent.children.each { |child| child.terminate if child.attached_to == self && child.waiting? } if parent
  parent.has_ended(self) if parent && notify_parent
end