Class LabelledChunkFinder
java.lang.Object
org.jenkinsci.plugins.workflow.graphanalysis.LabelledChunkFinder
- All Implemented Interfaces:
ChunkFinder
Splits a flow execution into
FlowChunks whenever you have a label.
This works for labelled blocks or single-step labels.
Useful for collecting stages and parallel branches.- Author:
- Sam Van Oort
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisChunkEnd(FlowNode current, FlowNode previous) End is where the previous node is a chunk start or this is aBlockEndNodewhoseBlockStartNodehas a label actionbooleanisChunkStart(FlowNode current, FlowNode previous) Start is anywhere with aLabelActionbooleanIf true, a chunk is implicitly created whenever we begin.
-
Constructor Details
-
LabelledChunkFinder
public LabelledChunkFinder()
-
-
Method Details
-
isStartInsideChunk
public boolean isStartInsideChunk()Description copied from interface:ChunkFinderIf true, a chunk is implicitly created whenever we begin.If you are matching the start/end of a block, should always return false.
If you are trying to match markers (such as single-node labels or milestones), should always be true.
- Specified by:
isStartInsideChunkin interfaceChunkFinder
-
isChunkStart
Start is anywhere with aLabelAction- Specified by:
isChunkStartin interfaceChunkFinder- Parameters:
current- Node to test for being a start, it will begin the chunk and be includedprevious- Previous node, to use in testing chunk- Returns:
- True if current node is the beginning of chunk
-
isChunkEnd
End is where the previous node is a chunk start or this is aBlockEndNodewhoseBlockStartNodehas a label action- Specified by:
isChunkEndin interfaceChunkFinder- Parameters:
current- Node to test for being endFor a block, the
BlockEndNodeFor a legacy stage or marker, this will be first node of new stage (previous is the marker)
previous- Previous node, to use in testing chunk- Returns:
- True if current is the end of a chunk (inclusive)
-