Module: MARS::Rendering::Graph::SequentialWorkflow

Includes:
Base
Defined in:
lib/mars/rendering/graph/sequential_workflow.rb

Instance Method Summary collapse

Methods included from Base

#build_graph, #node_id

Instance Method Details

#to_graph(builder, parent_id: nil, value: nil) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/mars/rendering/graph/sequential_workflow.rb', line 9

def to_graph(builder, parent_id: nil, value: nil)
  builder.add_subgraph(node_id, name) if steps.any?

  parent_id, value, sink_nodes = build_steps_graph(builder, parent_id, value)

  builder.add_edge(parent_id, "out", value) if sink_nodes.empty?

  sink_nodes.flatten
end