Class FlowNode
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Actionable
org.jenkinsci.plugins.workflow.graph.FlowNode
- All Implemented Interfaces:
ModelObject
,Saveable
,SearchableModelObject
,SearchItem
,ModelObjectWithContextMenu
- Direct Known Subclasses:
AtomNode
,BlockEndNode
,BlockStartNode
One node in a flow graph.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
FlowNode
(FlowExecution exec, String id, List<FlowNode> parents) protected
FlowNode
(FlowExecution exec, String id, FlowNode... parents) -
Method Summary
Modifier and TypeMethodDescriptionboolean
<T extends Action>
TReturns a read-only view of the IDs for enclosing blocks of this flow node, innermost first.List<? extends BlockStartNode>
Get the list of enclosingBlockStartNode
s, starting from innermost, for this node.Get theid
of the enclosingBlockStartNode
for this node, or null if none.final ErrorAction
getError()
If this node has terminated with an error, return an object that indicates that.Returns colored orb that represents the current state of this node.getId()
Has to be unique within aFlowExecution
.Returns a read-only view of parents.final <T extends Action>
TgetPersistentAction
(Class<T> type) Return the first nontransientAction
on the FlowNode, without consultingTransientActionFactory
sfinal String
Reference from the parentSearchItem
is throughFlowExecution.getNode(String)
protected abstract String
Gets a human readable name for this type of the node.protected String
Gets a human readable text that may include aStepDescriptor.getFunctionName()
.getUrl()
Returns the URL of thisFlowNode
, relative to the context root of Jenkins.int
hashCode()
final boolean
isActive()
Checks whether a node is still part of the active part of the graph.final boolean
Deprecated.Return an iterator over all enclosing blocks, from the nearest-enclosing outward ("inside-out" order).protected Object
void
save()
Explicitly save all the actions in thisFlowNode
.protected void
setActions
(List<Action> actions) SPI for subtypes to directly manipulate the actions field.toString()
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, getAction, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Constructor Details
-
FlowNode
-
FlowNode
-
-
Method Details
-
readResolve
- Throws:
ObjectStreamException
-
isRunning
Deprecated.UsuallyisActive()
is what you want. If you really wanted the original behavior, useFlowExecution.isCurrentHead(org.jenkinsci.plugins.workflow.graph.FlowNode)
.Transient flag that indicates if this node is currently actively executing something.It will be false for a node which still has active children, like a step with a running body. It will also be false for something that has finished but is pending child node creation, such as a completed fork branch which is waiting for the join node to be created.
This can only go from true to false.
-
isActive
@Exported(name="running") public final boolean isActive()Checks whether a node is still part of the active part of the graph. UnlikeisRunning()
, this behaves intuitively for aBlockStartNode
: it will be considered active until theBlockEndNode
is added. -
getError
If this node has terminated with an error, return an object that indicates that. This is just a convenience method. -
getExecution
-
getParents
Returns a read-only view of parents. -
getEnclosingId
Get theid
of the enclosingBlockStartNode
for this node, or null if none. OnlyFlowStartNode
andFlowEndNode
should generally return null. -
getEnclosingBlocks
Get the list of enclosingBlockStartNode
s, starting from innermost, for this node. May be empty if we are theFlowStartNode
orFlowEndNode
-
iterateEnclosingBlocks
Return an iterator over all enclosing blocks, from the nearest-enclosing outward ("inside-out" order). Prefer this togetEnclosingBlocks()
unless you need ALL nodes, because it can evaluate lazily. -
getAllEnclosingIds
Returns a read-only view of the IDs for enclosing blocks of this flow node, innermost first. May be empty. -
getParentIds
-
getId
Has to be unique within aFlowExecution
. Needs to remain stable across serialization and JVM restarts.- See Also:
-
getSearchUrl
Reference from the parentSearchItem
is throughFlowExecution.getNode(String)
- Specified by:
getSearchUrl
in interfaceSearchItem
-
getDisplayName
- Specified by:
getDisplayName
in interfaceModelObject
-
getDisplayFunctionName
-
getIconColor
Returns colored orb that represents the current state of this node. -
getTypeDisplayName
Gets a human readable name for this type of the node. This is used to implementgetDisplayName()
as a fallback in caseLabelAction
does not exist. -
getTypeFunctionName
Gets a human readable text that may include aStepDescriptor.getFunctionName()
. It would return "echo" for a flow node linked to an EchoStep or "ws {" for WorkspaceStep. For StepEndNode it would return "} // step.getFunctionName()". Note that this method should be abstract (supposed to be implemented in all subclasses), but keeping it non-abstract to avoid binary incompatibilities.- Returns:
- the text human-readable representation of the step function name
or
getDisplayName()
by default (if not overriden in subclasses)
-
getUrl
Returns the URL of thisFlowNode
, relative to the context root of Jenkins.- Returns:
- String like "job/foo/32/execution/node/abcde/" with no leading slash but trailing slash.
- Throws:
IOException
-
setActions
SPI for subtypes to directly manipulate the actions field. When a brand newFlowNode
is created, or whenFlowNode
and actions are stored in close proximity, it is convenient to be able to set theactions
so as to eliminate the separate call toFlowActionStorage.loadActions(FlowNode)
. This method provides such an opportunity for subtypes. -
getPersistentAction
Return the first nontransientAction
on the FlowNode, without consultingTransientActionFactory
sThis is not restricted to just Actions implementing
PersistentAction
but usually they should. Used here because it is much faster than basegetAction(Class)
method.- Type Parameters:
T
- Action type- Parameters:
type
- Class of action- Returns:
- First nontransient action or null if not found.
-
getAction
- Overrides:
getAction
in classActionable
-
getActions
- Overrides:
getActions
in classActionable
-
save
- Specified by:
save
in interfaceSaveable
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-
isActive()
is what you want.