Package org.jenkinsci.plugins.workflow.graphanalysis

Provides a library of methods to work with and analyze the graph of FlowNodes produced from a pipeline execution.

The core APIs are described in the javadocs for AbstractFlowScanner But in general it provides for iteration through the Directed Acyclic Graph (DAG) of a flow, filtering, search for matches, and visiting all nodes via internal iteration.

Static methods and a few implementations are also provided in FlowScanningUtils.

How To Pick A FlowScanner For Iteration

  1. Want fast iteration, don't care about visiting every node or parallels? LinearScanner
  2. Visit every node as fast as possible? DepthFirstScanner
  3. Visit every block in a predictable order, from end to start? ForkScanner
  4. Fastest way to find preceding sibling or enclosing nodes? LinearBlockHoppingScanner

Methods to iterate through flow graph and break it into chunks (regions) of interest, with nesting possible and reporting of branches:

Basic APIs

  1. ChunkFinder - API to define conditions for starting/ending a chunk
  2. SimpleChunkVisitor - Visitor API that accepts callbacks for chunk boundaries/contenst + parallel branching
  3. FlowChunk - A region of interest, defined by its first and last nodes
  4. FlowChunkWithContext - A FlowChunk that knows about the nodes before/after it, to give context for determining success/failure and the time taken to execute

Data structures and implementations: