Package com.google.adk.workflow
Class EdgesBuilder
java.lang.Object
com.google.adk.workflow.EdgesBuilder
A builder for the edges of a workflow graph, declared as chains of calls that start at
from(com.google.adk.workflow.Node) or fromStart(). Create one with new EdgesBuilder() and call build(),
or let Workflow.Builder.edges(Consumer) do both. A node is identified by its instance, so
create each node once.
Workflow support =
Workflow.builder()
.name("support_triage")
.edges(
g -> {
g.fromStart()
.chain(classify, category)
.route(
r -> {
r.on("billing").then(billing);
r.otherwise(summarize);
});
g.from(billing).then(summarize);
})
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA chain of edges positioned at a node, started byfrom(Node),fromStart()orEdgesBuilder.NodeGroupChain.joinTo(com.google.adk.workflow.JoinNode).static final classA chain of edges positioned at a node group from a fan-out,from(Node, Node, Node...), orfrom(Collection), whichEdgesBuilder.NodeGroupChain.joinTo(com.google.adk.workflow.JoinNode)connects to aJoinNode.static final classA routing map configured inEdgesBuilder.EdgeChain.route(java.util.function.Consumer<? super com.google.adk.workflow.EdgesBuilder.RouteMap>)that maps each route the source node may emit to the nodes it leads to, writtenr.on("billing").then(billing).static final classA routing-map entry started byEdgesBuilder.RouteMap.on(java.lang.String)whose routes have no target yet;EdgesBuilder.RouteMapEntry.then(com.google.adk.workflow.Node, com.google.adk.workflow.Node...)completes it.static final classA set of routes that select a single edge, which fires once when its source emits any of them; separate edges to the same target would fire once each. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<Edge>build()Returns the edges added so far, in the order they were added.Starts a chain of edges atnode:g.from(a).then(b).then(c).Starts a chain atfirst,secondand each node inrestso they can join without a fan-out:g.from(a, b).joinTo(join).from(Collection<? extends Node> nodes) Starts a chain atnodes(such as a computed list) so they can join without a fan-out, likefrom(Node, Node, Node...).Starts a chain of edges atStart:g.fromStart().then(a).
-
Constructor Details
-
EdgesBuilder
public EdgesBuilder()
-
-
Method Details
-
from
Starts a chain of edges atnode:g.from(a).then(b).then(c). -
from
Starts a chain atnodes(such as a computed list) so they can join without a fan-out, likefrom(Node, Node, Node...). -
from
Starts a chain atfirst,secondand each node inrestso they can join without a fan-out:g.from(a, b).joinTo(join). -
fromStart
Starts a chain of edges atStart:g.fromStart().then(a). -
build
Returns the edges added so far, in the order they were added.
-