Class: Factor::Runtime::WorkflowInstance

Inherits:
Object
  • Object
show all
Defined in:
lib/runtime/workflow_instance.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workflow, attributes) ⇒ WorkflowInstance

Returns a new instance of WorkflowInstance.



8
9
10
11
12
13
14
15
# File 'lib/runtime/workflow_instance.rb', line 8

def initialize(workflow,attributes)
  @id=SecureRandom.hex
  @attributes = attributes
  @workflow = workflow
  @start_message = Message.new(@attributes)
  @start_message.workflow_instance_id=@id
  @start_message.position=["start"]
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



6
7
8
# File 'lib/runtime/workflow_instance.rb', line 6

def attributes
  @attributes
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/runtime/workflow_instance.rb', line 6

def id
  @id
end

#start_messageObject

Returns the value of attribute start_message.



6
7
8
# File 'lib/runtime/workflow_instance.rb', line 6

def start_message
  @start_message
end

#workflowObject

Returns the value of attribute workflow.



6
7
8
# File 'lib/runtime/workflow_instance.rb', line 6

def workflow
  @workflow
end

Instance Method Details

#get_activity(position) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/runtime/workflow_instance.rb', line 17

def get_activity(position)
  last_position=@workflow
  position.each do |section|
    return nil if last_position[section].nil?
    last_position=last_position[section]
  end
  last_position
end