class Swarm::Process

Public Instance Methods

_launch() click to toggle source
# File lib/swarm/process.rb, line 20
def _launch
  new_expression = SequenceExpression.create(
    :hive => hive,
    :parent_id => id,
    :position => [0],
    :workitem => workitem,
    :process_id => id
  )
  new_expression.apply
  self.root_expression_id = new_expression.id
  save
end
finished?() click to toggle source
# File lib/swarm/process.rb, line 33
def finished?
  reload!
  root_expression && root_expression.replied?
end
launch() click to toggle source
# File lib/swarm/process.rb, line 15
def launch
  hive.queue('launch', self)
  self
end
move_on_from(expression) click to toggle source
# File lib/swarm/process.rb, line 43
def move_on_from(expression)
  self.workitem = expression.workitem
  save
  if parent_expression
    parent_expression.move_on_from(self)
  end
end
node_at_position(position) click to toggle source
# File lib/swarm/process.rb, line 38
def node_at_position(position)
  raise ArgumentError unless position == 0
  process_definition.tree
end
wait_until_finished(timeout: 5) click to toggle source
# File lib/swarm/process.rb, line 11
def wait_until_finished(timeout: 5)
  Swarm::Support.wait_until(timeout: timeout) { finished? }
end