class Orchestra::Execution::Step
Attributes
context[RW]
Public Class Methods
execute(step, *args)
click to toggle source
# File lib/orchestra/execution.rb, line 75 def self.execute step, *args instance = new step, *args instance.execute end
new(step, *args)
click to toggle source
# File lib/orchestra/execution.rb, line 80 def self.new step, *args if step.is_a? Orchestra::Operation klass = EmbeddedOperation else klass = step.collection ? CollectionStep : self end instance = klass.allocate instance.send :initialize, step, *args instance end
new(step, name, operation_execution)
click to toggle source
# File lib/orchestra/execution.rb, line 93 def initialize step, name, operation_execution @name = name @operation_execution = operation_execution @step = step @context = build_context end
Public Instance Methods
build_context()
click to toggle source
# File lib/orchestra/execution.rb, line 119 def build_context step.build_context operation_execution.state end
execute()
click to toggle source
# File lib/orchestra/execution.rb, line 100 def execute @node = Recording::Node.new step, name, input operation_execution.publish :step_entered, node, node.input output = step.process invoke operation_execution.publish :step_exited, node, output output end
input()
click to toggle source
# File lib/orchestra/execution.rb, line 108 def input registry = operation_execution.registry operation_execution.state.reject do |key, val| registry[key] == val or not step.dependencies.include? key end end
invoke()
click to toggle source
# File lib/orchestra/execution.rb, line 115 def invoke context.execute end
to_node()
click to toggle source
# File lib/orchestra/execution.rb, line 123 def to_node Node.new step, name end