lib/floe/workflow/state.rb in floe-0.1.1 vs lib/floe/workflow/state.rb in floe-0.2.0
- old
+ new
@@ -36,10 +36,14 @@
def context
workflow.context
end
+ def status
+ end? ? "success" : "running"
+ end
+
def run!(input)
logger.info("Running state: [#{name}] with input [#{input}]")
input = input_path.value(context, input)
@@ -50,27 +54,9 @@
output = output_path&.value(context, output)
logger.info("Running state: [#{name}] with input [#{input}]...Complete - next state: [#{next_state&.name}] output: [#{output}]")
[next_state, output]
- end
-
- def to_dot
- String.new.tap do |s|
- s << " #{name}"
-
- attributes = to_dot_attributes
- s << " [ #{attributes.to_a.map { |kv| kv.join("=") }.join(" ")} ]" unless attributes.empty?
- end
- end
-
- private def to_dot_attributes
- end? ? {:style => "bold"} : {}
- end
-
- def to_dot_transitions
- next_state_name = payload["Next"] unless end?
- Array(next_state_name && " #{name} -> #{next_state_name}")
end
end
end
end