Class FlowScanningUtils
java.lang.Object
org.jenkinsci.plugins.workflow.graphanalysis.FlowScanningUtils
Library of common functionality when analyzing/walking flow graphs
- Author:
- Sam Van Oort
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparator<FlowNode>
static final com.google.common.base.Predicate<FlowNode>
static final Comparator<FlowNode>
Sorts flownodes putting the one begun last (oldest startTime) at the end, with null times last because likely they represent the newest nodes with aTimingAction
not attached yet. -
Method Summary
Modifier and TypeMethodDescriptionstatic Filterator<FlowNode>
Deprecated.static com.google.common.base.Predicate<FlowNode>
hasActionPredicate
(Class<? extends Action> actionClass) Create a predicate that will match on all FlowNodes having a specific action present
-
Field Details
-
MATCH_BLOCK_START
-
TIME_ORDER_COMPARATOR
Sorts flownodes putting the one begun last (oldest startTime) at the end, with null times last because likely they represent the newest nodes with aTimingAction
not attached yet. -
ID_ORDER_COMPARATOR
-
-
Method Details
-
hasActionPredicate
@NonNull public static com.google.common.base.Predicate<FlowNode> hasActionPredicate(@NonNull Class<? extends Action> actionClass) Create a predicate that will match on all FlowNodes having a specific action present- Parameters:
actionClass
- Action class to look for- Returns:
- Predicate that will match when FlowNode has the action given
-
fetchEnclosingBlocks
Deprecated.Returns allBlockStartNode
s enclosing the given FlowNode, starting from the inside out. This is useful if we want to obtain information about its scope, such as the workspace, parallel branch, or label. Warning: while this is efficient for one node, batch operations are far more efficient when handling many nodes.Deprecated, prefer
FlowNode.iterateEnclosingBlocks()
instead, possibly usingFilteratorImpl(Iterator, Predicate)
or Guava or Java 8 APIs if filtering needed.- Parameters:
f
-FlowNode
to start from.- Returns:
- Iterator that returns all enclosing BlockStartNodes from the inside out.
-