Class: Factor::Runtime::WorkflowInstance
- Inherits:
-
Object
- Object
- Factor::Runtime::WorkflowInstance
- Defined in:
- lib/runtime/workflow_instance.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#id ⇒ Object
Returns the value of attribute id.
-
#start_message ⇒ Object
Returns the value of attribute start_message.
-
#workflow ⇒ Object
Returns the value of attribute workflow.
Instance Method Summary collapse
- #get_activity(position) ⇒ Object
-
#initialize(workflow, attributes) ⇒ WorkflowInstance
constructor
A new instance of WorkflowInstance.
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
#attributes ⇒ Object
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/runtime/workflow_instance.rb', line 6 def attributes @attributes end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/runtime/workflow_instance.rb', line 6 def id @id end |
#start_message ⇒ Object
Returns the value of attribute start_message.
6 7 8 |
# File 'lib/runtime/workflow_instance.rb', line 6 def @start_message end |
#workflow ⇒ Object
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 |