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

Inherits:
Floe::Workflow::State show all
Includes:
InputOutputMixin, NonTerminalMixin
Defined in:
lib/floe/workflow/states/pass.rb

Instance Attribute Summary collapse

Attributes inherited from Floe::Workflow::State

#comment, #name, #payload, #type

Instance Method Summary collapse

Methods included from NonTerminalMixin

#validate_state_next!

Methods included from InputOutputMixin

#process_input, #process_output

Methods inherited from Floe::Workflow::State

build!, #finished?, #long_name, #mark_error, #mark_finished, #mark_started, #ready?, #run_nonblock!, #short_name, #start, #started?, #wait, #wait_until, #waiting?

Methods included from ValidationMixin

included, #invalid_field_error!, #missing_field_error!, #parser_error!, #runtime_field_error!, #workflow_state?, #wrap_parser_error

Constructor Details

#initialize(workflow, name, payload) ⇒ Pass

Returns a new instance of Pass.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/floe/workflow/states/pass.rb', line 12

def initialize(workflow, name, payload)
  super

  @next        = payload["Next"]
  @end         = !!payload["End"]
  @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", "$"))

  validate_state!(workflow)
end

Instance Attribute Details

#endObject (readonly)

Returns the value of attribute end.



10
11
12
# File 'lib/floe/workflow/states/pass.rb', line 10

def end
  @end
end

#input_pathObject (readonly)

Returns the value of attribute input_path.



10
11
12
# File 'lib/floe/workflow/states/pass.rb', line 10

def input_path
  @input_path
end

#nextObject (readonly)

Returns the value of attribute next.



10
11
12
# File 'lib/floe/workflow/states/pass.rb', line 10

def next
  @next
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



10
11
12
# File 'lib/floe/workflow/states/pass.rb', line 10

def output_path
  @output_path
end

#parametersObject (readonly)

Returns the value of attribute parameters.



10
11
12
# File 'lib/floe/workflow/states/pass.rb', line 10

def parameters
  @parameters
end

#resultObject (readonly)

Returns the value of attribute result.



10
11
12
# File 'lib/floe/workflow/states/pass.rb', line 10

def result
  @result
end

#result_pathObject (readonly)

Returns the value of attribute result_path.



10
11
12
# File 'lib/floe/workflow/states/pass.rb', line 10

def result_path
  @result_path
end

Instance Method Details

#end?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/floe/workflow/states/pass.rb', line 37

def end?
  @end
end

#finish(context) ⇒ Object



27
28
29
30
31
# File 'lib/floe/workflow/states/pass.rb', line 27

def finish(context)
  input = result.nil? ? process_input(context) : result
  context.output = process_output(context, input)
  super
end

#running?(_) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/floe/workflow/states/pass.rb', line 33

def running?(_)
  false
end