Class: ManageIQ::Floe::Workflow::States::Pass

Inherits:
ManageIQ::Floe::Workflow::State show all
Defined in:
lib/manageiq/floe/workflow/states/pass.rb

Instance Attribute Summary collapse

Attributes inherited from ManageIQ::Floe::Workflow::State

#comment, #name, #payload, #type, #workflow

Instance Method Summary collapse

Methods inherited from ManageIQ::Floe::Workflow::State

build!, #context, #end?, #to_dot, #to_dot_transitions

Methods included from Logging

included, #logger

Constructor Details

#initialize(workflow, name, payload) ⇒ Pass

Returns a new instance of Pass.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/manageiq/floe/workflow/states/pass.rb', line 10

def initialize(workflow, name, payload)
  super

  @next        = payload["Next"]
  @result      = payload["Result"]

  @parameters  = PayloadTemplate.new(payload["Parameters"]) if payload["Parameters"]
  @input_path  = Path.new(payload.fetch("InputPath", "$"))
  @output_path = Path.new(payload.fetch("OutputPath", "$"))
  @result_path = ReferencePath.new(payload.fetch("ResultPath", "$"))
end

Instance Attribute Details

#endObject (readonly)

Returns the value of attribute end.



8
9
10
# File 'lib/manageiq/floe/workflow/states/pass.rb', line 8

def end
  @end
end

#input_pathObject (readonly)

Returns the value of attribute input_path.



8
9
10
# File 'lib/manageiq/floe/workflow/states/pass.rb', line 8

def input_path
  @input_path
end

#nextObject (readonly)

Returns the value of attribute next.



8
9
10
# File 'lib/manageiq/floe/workflow/states/pass.rb', line 8

def next
  @next
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



8
9
10
# File 'lib/manageiq/floe/workflow/states/pass.rb', line 8

def output_path
  @output_path
end

#parametersObject (readonly)

Returns the value of attribute parameters.



8
9
10
# File 'lib/manageiq/floe/workflow/states/pass.rb', line 8

def parameters
  @parameters
end

#resultObject (readonly)

Returns the value of attribute result.



8
9
10
# File 'lib/manageiq/floe/workflow/states/pass.rb', line 8

def result
  @result
end

#result_pathObject (readonly)

Returns the value of attribute result_path.



8
9
10
# File 'lib/manageiq/floe/workflow/states/pass.rb', line 8

def result_path
  @result_path
end

Instance Method Details

#run!Object



22
23
24
25
26
27
28
# File 'lib/manageiq/floe/workflow/states/pass.rb', line 22

def run!(*)
  super do |input|
    output = input
    output = result_path.set(output, result) if result && result_path
    output
  end
end