Class: Dynflow::Director::FlowManager
- Inherits:
-
Object
- Object
- Dynflow::Director::FlowManager
- Includes:
- Algebrick::TypeCheck
- Defined in:
- lib/dynflow/director/flow_manager.rb
Instance Attribute Summary collapse
-
#cursor_index ⇒ Object
readonly
Returns the value of attribute cursor_index.
-
#execution_plan ⇒ Object
readonly
Returns the value of attribute execution_plan.
Instance Method Summary collapse
- #done? ⇒ Boolean
-
#initialize(execution_plan, flow) ⇒ FlowManager
constructor
A new instance of FlowManager.
-
#start ⇒ Set
Of steps to continue with.
-
#what_is_next(flow_step) ⇒ Set
Of steps to continue with.
Constructor Details
#initialize(execution_plan, flow) ⇒ FlowManager
Returns a new instance of FlowManager.
10 11 12 13 14 15 |
# File 'lib/dynflow/director/flow_manager.rb', line 10 def initialize(execution_plan, flow) @execution_plan = Type! execution_plan, ExecutionPlan @flow = flow @cursor_index = {} @cursor = build_root_cursor end |
Instance Attribute Details
#cursor_index ⇒ Object (readonly)
Returns the value of attribute cursor_index.
8 9 10 |
# File 'lib/dynflow/director/flow_manager.rb', line 8 def cursor_index @cursor_index end |
#execution_plan ⇒ Object (readonly)
Returns the value of attribute execution_plan.
8 9 10 |
# File 'lib/dynflow/director/flow_manager.rb', line 8 def execution_plan @execution_plan end |
Instance Method Details
#done? ⇒ Boolean
17 18 19 |
# File 'lib/dynflow/director/flow_manager.rb', line 17 def done? @cursor.done? end |
#start ⇒ Set
Returns of steps to continue with.
30 31 32 33 34 |
# File 'lib/dynflow/director/flow_manager.rb', line 30 def start return @cursor.what_is_next.tap do |steps| raise 'invalid state' if steps.empty? && !done? end end |
#what_is_next(flow_step) ⇒ Set
Returns of steps to continue with.
22 23 24 25 26 27 |
# File 'lib/dynflow/director/flow_manager.rb', line 22 def what_is_next(flow_step) return [] if flow_step.state == :suspended success = flow_step.state != :error return cursor_index[flow_step.id].what_is_next(flow_step, success) end |