Class: ManageIQ::Floe::Workflow::States::Fail

Inherits:
ManageIQ::Floe::Workflow::State show all
Defined in:
lib/manageiq/floe/workflow/states/fail.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, #to_dot, #to_dot_transitions

Methods included from Logging

included, #logger

Constructor Details

#initialize(workflow, name, payload) ⇒ Fail

Returns a new instance of Fail.



10
11
12
13
14
15
# File 'lib/manageiq/floe/workflow/states/fail.rb', line 10

def initialize(workflow, name, payload)
  super

  @cause = payload["Cause"]
  @error = payload["Error"]
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



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

def cause
  @cause
end

#errorObject (readonly)

Returns the value of attribute error.



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

def error
  @error
end

Instance Method Details

#end?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/manageiq/floe/workflow/states/fail.rb', line 28

def end?
  true
end

#run!(input) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/manageiq/floe/workflow/states/fail.rb', line 17

def run!(input)
  logger.info("Running state: [#{name}] with input [#{input}]")

  next_state = nil
  output     = input

  logger.info("Running state: [#{name}] with input [#{input}]...Complete - next state: [#{next_state&.name}]")

  [next_state, output]
end