Sha256: cd0c55a473554b0dda734873b8e11fb857c2da6d5a16879edbbbe073f1518841

Contents?: true

Size: 863 Bytes

Versions: 5

Compression:

Stored size: 863 Bytes

Contents

# -*- coding: utf-8 -*-
require 'tengine/job'

# ジョブネットの終端を表すVertex。特に状態は持たない。
class Tengine::Job::End < Tengine::Job::Vertex

  # https://cacoo.com/diagrams/hdLgrzYsTBBpV3Wj#D26C1
  def transmit(signal)
    activate(signal)
  end

  def activate(signal)
    complete_origin_edge(signal, :except_closed => true)
    parent = self.parent # Endのparentであるジョブネット
    parent_finally = parent.finally_vertex
    if parent_finally && (parent.phase_key != :dying)
      parent_finally.transmit(signal)
    else
      parent.finish(signal) unless parent.phase_key == :stuck
    end
  end

  def reset(signal)
    parent = self.parent # Endのparentであるジョブネット
    if signal.execution.in_scope?(parent)
      if f = parent.finally_vertex
        f.reset(signal)
      end
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tengine_job-1.1.0 lib/tengine/job/end.rb
tengine_job-0.6.13 lib/tengine/job/end.rb
tengine_job-0.6.12 lib/tengine/job/end.rb
tengine_job-0.6.11 lib/tengine/job/end.rb
tengine_job-0.6.10 lib/tengine/job/end.rb