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
ConstructorsModifierConstructorDescriptionprotectedFlowNode(FlowExecution exec, String id, List<FlowNode> parents) protectedFlowNode(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 enclosingBlockStartNodes, starting from innermost, for this node.Get theidof the enclosingBlockStartNodefor this node, or null if none.final ErrorActiongetError()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 nontransientActionon the FlowNode, without consultingTransientActionFactorysfinal StringReference from the parentSearchItemis throughFlowExecution.getNode(String)protected abstract StringGets a human readable name for this type of the node.protected StringGets a human readable text that may include aStepDescriptor.getFunctionName().getUrl()Returns the URL of thisFlowNode, relative to the context root of Jenkins.inthashCode()final booleanisActive()Checks whether a node is still part of the active part of the graph.final booleanDeprecated.Return an iterator over all enclosing blocks, from the nearest-enclosing outward ("inside-out" order).protected Objectvoidsave()Explicitly save all the actions in thisFlowNode.protected voidsetActions(List<Action> actions) SPI for subtypes to directly manipulate the actions field.toString()Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface hudson.search.SearchItem
getSearchGroup, getSearchIcon
-
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 theBlockEndNodeis 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 theidof the enclosingBlockStartNodefor this node, or null if none. OnlyFlowStartNodeandFlowEndNodeshould generally return null. -
getEnclosingBlocks
Get the list of enclosingBlockStartNodes, starting from innermost, for this node. May be empty if we are theFlowStartNodeorFlowEndNode -
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 parentSearchItemis throughFlowExecution.getNode(String)- Specified by:
getSearchUrlin interfaceSearchItem
-
getDisplayName
- Specified by:
getDisplayNamein 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 caseLabelActiondoes 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 newFlowNodeis created, or whenFlowNodeand actions are stored in close proximity, it is convenient to be able to set theactionsso as to eliminate the separate call toFlowActionStorage.loadActions(FlowNode). This method provides such an opportunity for subtypes. -
getPersistentAction
Return the first nontransientActionon the FlowNode, without consultingTransientActionFactorysThis is not restricted to just Actions implementing
PersistentActionbut 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:
getActionin classActionable
-
getActions
- Overrides:
getActionsin classActionable
-
save
- Specified by:
savein interfaceSaveable- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-
isActive()is what you want.