class Petri::TaskTransition

Attributes

task_identifier[R]

Public Class Methods

new(net, data = {}) click to toggle source

@param net [Net] @param data [Hash<Symbol>]

Calls superclass method
# File lib/petri/task_transition.rb, line 9
def initialize(net, data = {})
  super
  @task_identifier = @data[:task_identifier]
  @data[:identifier] = generate_identifier
end

Public Instance Methods

cancel?() click to toggle source
# File lib/petri/task_transition.rb, line 31
def cancel?
  pin == 'Cancel'
end
create?() click to toggle source
# File lib/petri/task_transition.rb, line 15
def create?
  pin == 'Create'
end
finish?() click to toggle source
# File lib/petri/task_transition.rb, line 19
def finish?
  pin == 'Finish'
end
pause?() click to toggle source
# File lib/petri/task_transition.rb, line 23
def pause?
  pin == 'Pause'
end
pin() click to toggle source
# File lib/petri/task_transition.rb, line 35
def pin
  @data[:pin]
end
resume?() click to toggle source
# File lib/petri/task_transition.rb, line 27
def resume?
  pin == 'Resume'
end
subprocess_identifier() click to toggle source
Petri::Subprocess
# File lib/petri/task_transition.rb, line 40
def subprocess_identifier
  task_identifier
end

Private Instance Methods

generate_identifier() click to toggle source
# File lib/petri/task_transition.rb, line 46
def generate_identifier
  if create?
    "Create \"#{@task_identifier}\" task"
  elsif finish?
    "Finish \"#{@task_identifier}\" task"
  elsif pause?
    "Pause \"#{@task_identifier}\" task"
  elsif resume?
    "Resume \"#{@task_identifier}\" task"
  elsif cancel?
    "Cancel \"#{@task_identifier}\" task"
  end
end