Class FlowNode

    • Method Detail

      • isRunning

        @Deprecated
        public final boolean isRunning()
        Deprecated.
        Usually isActive() is what you want. If you really wanted the original behavior, use FlowExecution.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. Unlike isRunning(), this behaves intuitively for a BlockStartNode: it will be considered active until the BlockEndNode is added.
      • getError

        @CheckForNull
        public final ErrorAction getError()
        If this node has terminated with an error, return an object that indicates that. This is just a convenience method.
      • getParents

        @NonNull
        public List<FlowNode> getParents()
        Returns a read-only view of parents.
      • iterateEnclosingBlocks

        @NonNull
        public Iterable<BlockStartNode> iterateEnclosingBlocks()
        Return an iterator over all enclosing blocks, from the nearest-enclosing outward ("inside-out" order). Prefer this to getEnclosingBlocks() unless you need ALL nodes, because it can evaluate lazily.
      • getAllEnclosingIds

        @NonNull
        public List<String> getAllEnclosingIds()
        Returns a read-only view of the IDs for enclosing blocks of this flow node, innermost first. May be empty.
      • getParentIds

        @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class)
        @Exported(name="parents")
        @NonNull
        public List<String> getParentIds()
      • getDisplayFunctionName

        public String getDisplayFunctionName()
      • getIconColor

        @Exported
        public BallColor getIconColor()
        Returns colored orb that represents the current state of this node.
      • getTypeDisplayName

        protected abstract String getTypeDisplayName()
        Gets a human readable name for this type of the node. This is used to implement getDisplayName() as a fallback in case LabelAction does not exist.
      • getTypeFunctionName

        protected String getTypeFunctionName()
        Gets a human readable text that may include a StepDescriptor.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

        @Exported
        public String getUrl()
                      throws IOException
        Returns the URL of this FlowNode, 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

        protected void setActions​(List<Action> actions)
        SPI for subtypes to directly manipulate the actions field. When a brand new FlowNode is created, or when FlowNode and actions are stored in close proximity, it is convenient to be able to set the actions so as to eliminate the separate call to FlowActionStorage.loadActions(FlowNode). This method provides such an opportunity for subtypes.
      • getPersistentAction

        @CheckForNull
        public final <T extends Action> T getPersistentAction​(@NonNull
                                                              Class<T> type)
        Return the first nontransient Action on the FlowNode, without consulting TransientActionFactorys

        This is not restricted to just Actions implementing PersistentAction but usually they should. Used here because it is much faster than base getAction(Class) method.

        Type Parameters:
        T - Action type
        Parameters:
        type - Class of action
        Returns:
        First nontransient action or null if not found.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object