Interface ICreateFlowGraphContext<TElement extends IWorkflowNodeTypeProviding>
-
- Type Parameters:
TElement
- The type of the node elements on which the analysis is performed. This type may be different depending on whether the analysis is performed on the backend data modelWorkflowNode
or the frontend view model.
public interface ICreateFlowGraphContext<TElement extends IWorkflowNodeTypeProviding>
Context provided to the node handlers during a call tocreateFlowGraph
. Handlers may use this context to recursively analyze their children as well.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description int
childCount(TElement node)
default void
connect(com.google.common.collect.ImmutableSet<NodeKey> from, NodeKey to)
Deprecated.void
connect(com.google.common.collect.ImmutableSet<NodeKey> from, NodeKey to, IFlowGraphEdgeDataConfigurator data)
For eachsource
infrom
, adds an edge(source, to)
to the flow graph.default void
connect(com.google.common.collect.ImmutableSet<NodeKey> from, TElement toParent, int toChildIndex)
void
connect(com.google.common.collect.ImmutableSet<NodeKey> from, TElement toParent, int toChildIndex, IFlowGraphEdgeDataConfigurator data)
Finds thechild
at the given index in thetoParent
and adds an edge(from, child)
to the flow graph.default void
connect(NodeKey from, NodeKey to)
Deprecated.void
connect(NodeKey from, NodeKey to, IFlowGraphEdgeDataConfigurator data)
Adds an edge(from, to)
to the flow graph.default void
connect(TElement from, TElement to)
void
connect(TElement from, TElement to, IFlowGraphEdgeDataConfigurator data)
Adds an edge(from, to)
to the flow graph.default void
connectParentToChild(TElement parent, int childIndex)
void
connectParentToChild(TElement parent, int childIndex, IFlowGraphEdgeDataConfigurator data)
Adds an edge(from, to)
to the flow graph.IFlowGraphEndPoints
createFlowGraph(TElement node)
Creates the flow graph for the given node and return its end points.IFlowGraphEndPoints
createFlowGraphForChild(TElement parent, int childIndex)
Creates the flow graph for the given node and return its end points.NodeKey
createNodeKey(TElement element)
Creates the element key that needs to be entered in the list of potentially reachable nodes.IFlowGraphEndPoints
endPoints(com.google.common.collect.ImmutableSet<NodeKey> normalEndPoints, com.google.common.collect.ImmutableSet<NodeKey> throwingEndPoints)
IFlowGraphEndPoints
endPointsAlwaysReturning()
IFlowGraphEndPoints
endPointsNeverNormal(com.google.common.collect.ImmutableSet<NodeKey> throwingEndPoints)
IFlowGraphEndPoints
endPointsNeverThrowing(com.google.common.collect.ImmutableSet<NodeKey> normalEndPoints)
IFlowGraphEndPoints
endPointsSameNormalAndThrowing(com.google.common.collect.ImmutableSet<NodeKey> endPoints)
boolean
isHasChild(TElement node, int childIndex)
com.google.common.collect.ImmutableSet<NodeKey>
union(com.google.common.collect.ImmutableSet<NodeKey>... sets)
Helper method that computes the union of all given sets.com.google.common.collect.ImmutableSet<NodeKey>
union(com.google.common.collect.ImmutableSet<NodeKey> set1, com.google.common.collect.ImmutableSet<NodeKey> set2)
Helper method that computes the union of all given sets.com.google.common.collect.ImmutableSet<NodeKey>
union(Iterable<com.google.common.collect.ImmutableSet<NodeKey>> sets)
Helper method that computes the union of all given sets.
-
-
-
Method Detail
-
childCount
int childCount(TElement node)
- Parameters:
node
- Node to check.- Returns:
- Number of children the given node contains.
-
connect
@Deprecated default void connect(com.google.common.collect.ImmutableSet<NodeKey> from, NodeKey to)
Deprecated.For eachsource
infrom
, adds an edge(source, to)
to the flow graph.- Parameters:
from
- Source node.to
- Target node.
-
connect
void connect(com.google.common.collect.ImmutableSet<NodeKey> from, NodeKey to, IFlowGraphEdgeDataConfigurator data)
For eachsource
infrom
, adds an edge(source, to)
to the flow graph.- Parameters:
from
- Source node.to
- Target node.data
- For setting the edge data on the added edges. SeeICreateFlowGraphParams.normalEdge()
etc. for standard implementations.- Since:
- 8.0.0
-
connect
@Deprecated default void connect(com.google.common.collect.ImmutableSet<NodeKey> from, TElement toParent, int toChildIndex)
Deprecated.Finds thechild
at the given index in thetoParent
and adds an edge(from, child)
to the flow graph.- Parameters:
from
- Source node.toParent
- Parent with the target node.toChildIndex
- Index of the target node in the parent node.
-
connect
void connect(com.google.common.collect.ImmutableSet<NodeKey> from, TElement toParent, int toChildIndex, IFlowGraphEdgeDataConfigurator data)
Finds thechild
at the given index in thetoParent
and adds an edge(from, child)
to the flow graph.- Parameters:
from
- Source node.toParent
- Parent with the target node.toChildIndex
- Index of the target node in the parent node.data
- For setting the edge data on the added edges. SeeICreateFlowGraphParams.normalEdge()
etc. for standard implementations.- Since:
- 8.0.0
-
connect
@Deprecated default void connect(NodeKey from, NodeKey to)
Deprecated.Adds an edge(from, to)
to the flow graph.- Parameters:
from
- Source node.to
- Target node.
-
connect
void connect(NodeKey from, NodeKey to, IFlowGraphEdgeDataConfigurator data)
Adds an edge(from, to)
to the flow graph.- Parameters:
from
- Source node.to
- Target node.data
- For setting the edge data on the added edges. SeeICreateFlowGraphParams.normalEdge()
etc. for standard implementations.- Since:
- 8.0.0
-
connect
@Deprecated default void connect(TElement from, TElement to)
Deprecated.Adds an edge(from, to)
to the flow graph.- Parameters:
from
- Source node.to
- Target node.
-
connect
void connect(TElement from, TElement to, IFlowGraphEdgeDataConfigurator data)
Adds an edge(from, to)
to the flow graph.- Parameters:
from
- Source node.to
- Target node.data
- For setting the edge data on the added edges. SeeICreateFlowGraphParams.normalEdge()
etc. for standard implementations.- Since:
- 8.0.0
-
connectParentToChild
@Deprecated default void connectParentToChild(TElement parent, int childIndex)
Deprecated.Finds thechild
at the given index in thetoParent
and adds an edge(parent, child)
to the flow graph.- Parameters:
parent
- Parent node from which to draw a connection.childIndex
- Index of the parent's child to which to draw a connection.
-
connectParentToChild
void connectParentToChild(TElement parent, int childIndex, IFlowGraphEdgeDataConfigurator data)
Adds an edge(from, to)
to the flow graph.- Parameters:
parent
- Parent node from which to draw a connection.childIndex
- Index of the parent's child to which to draw a connection.data
- For setting the edge data on the added edges. SeeICreateFlowGraphParams.normalEdge()
etc. for standard implementations.- Since:
- 8.0.0
-
createFlowGraph
IFlowGraphEndPoints createFlowGraph(TElement node) throws WorkflowAnalysisException
Creates the flow graph for the given node and return its end points.- Parameters:
node
- Child to analyze.- Returns:
- The end points of the given node.
- Throws:
WorkflowAnalysisException
- When the analysis could not be completed, usually because a child threw an exception.
-
createFlowGraphForChild
IFlowGraphEndPoints createFlowGraphForChild(TElement parent, int childIndex) throws WorkflowAnalysisException
Creates the flow graph for the given node and return its end points.- Parameters:
parent
- Parent node with a child to analyze.childIndex
- Index of the child to analyze.- Returns:
- The end points of the given node.
- Throws:
WorkflowAnalysisException
- When the analysis could not be completed, usually because a child threw an exception.
-
createNodeKey
NodeKey createNodeKey(TElement element)
Creates the element key that needs to be entered in the list of potentially reachable nodes.- Parameters:
element
- Element for which to create the key.- Returns:
- The key of the element.
-
endPoints
IFlowGraphEndPoints endPoints(com.google.common.collect.ImmutableSet<NodeKey> normalEndPoints, com.google.common.collect.ImmutableSet<NodeKey> throwingEndPoints)
- Parameters:
normalEndPoints
- The value forIFlowGraphEndPoints.getNormalEndPoints()
throwingEndPoints
- The value forIFlowGraphEndPoints.getThrowingEndPoints()
.- Returns:
- A new POJO with the given data.
-
endPointsAlwaysReturning
IFlowGraphEndPoints endPointsAlwaysReturning()
- Returns:
- A new POJO with no normal and no throwing end points.
-
endPointsNeverNormal
IFlowGraphEndPoints endPointsNeverNormal(com.google.common.collect.ImmutableSet<NodeKey> throwingEndPoints)
- Parameters:
throwingEndPoints
- The value for bothIFlowGraphEndPoints.getThrowingEndPoints()
.- Returns:
- A new POJO with the given data and
IFlowGraphEndPoints.getNormalEndPoints()
set to an empty set.
-
endPointsNeverThrowing
IFlowGraphEndPoints endPointsNeverThrowing(com.google.common.collect.ImmutableSet<NodeKey> normalEndPoints)
- Parameters:
normalEndPoints
- The value for bothIFlowGraphEndPoints.getNormalEndPoints()
.- Returns:
- A new POJO with the given data and
IFlowGraphEndPoints.getThrowingEndPoints()
set to an empty set.
-
endPointsSameNormalAndThrowing
IFlowGraphEndPoints endPointsSameNormalAndThrowing(com.google.common.collect.ImmutableSet<NodeKey> endPoints)
- Parameters:
endPoints
- The value for bothIFlowGraphEndPoints.getNormalEndPoints()
andIFlowGraphEndPoints.getThrowingEndPoints()
.- Returns:
- A new POJO with the given data.
-
isHasChild
boolean isHasChild(TElement node, int childIndex)
- Parameters:
node
- Node to check.childIndex
- Index to check.- Returns:
true
when the node has a child at the given index,false
otherwise.
-
union
com.google.common.collect.ImmutableSet<NodeKey> union(com.google.common.collect.ImmutableSet<NodeKey>... sets)
Helper method that computes the union of all given sets.- Parameters:
sets
- More sets to unite.- Returns:
- A set representing the union of all input sets.
-
union
com.google.common.collect.ImmutableSet<NodeKey> union(com.google.common.collect.ImmutableSet<NodeKey> set1, com.google.common.collect.ImmutableSet<NodeKey> set2)
Helper method that computes the union of all given sets.- Parameters:
set1
- One set to combined.set2
- Another set to combined.- Returns:
- A set representing the union of all input sets.
-
-