Class LabelledChunkFinder
java.lang.Object
org.jenkinsci.plugins.workflow.graphanalysis.LabelledChunkFinder
- All Implemented Interfaces:
ChunkFinder
Splits a flow execution into
FlowChunk
s 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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isChunkEnd
(FlowNode current, FlowNode previous) End is where the previous node is a chunk start or this is aBlockEndNode
whoseBlockStartNode
has a label actionboolean
isChunkStart
(FlowNode current, FlowNode previous) Start is anywhere with aLabelAction
boolean
If true, a chunk is implicitly created whenever we begin.
-
Constructor Details
-
LabelledChunkFinder
public LabelledChunkFinder()
-
-
Method Details
-
isStartInsideChunk
public boolean isStartInsideChunk()Description copied from interface:ChunkFinder
If 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:
isStartInsideChunk
in interfaceChunkFinder
-
isChunkStart
Start is anywhere with aLabelAction
- Specified by:
isChunkStart
in 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 aBlockEndNode
whoseBlockStartNode
has a label action- Specified by:
isChunkEnd
in interfaceChunkFinder
- Parameters:
current
- Node to test for being endFor a block, the
BlockEndNode
For 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)
-