Java Code Examples for org.jenkinsci.plugins.workflow.graph.FlowNode#getActions()

The following examples show how to use org.jenkinsci.plugins.workflow.graph.FlowNode#getActions() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PipelineNodeUtil.java    From blueocean-plugin with MIT License 6 votes vote down vote up
public static boolean isSkippedStage(@Nullable FlowNode node){
    if(node == null){
        return false;
    }

    for (Action action : node.getActions()) {
        if (action instanceof TagsAction && ((TagsAction) action).getTagValue(StageStatus.TAG_NAME) != null) {
            TagsAction tagsAction =  (TagsAction) action;
            String value = tagsAction.getTagValue(StageStatus.TAG_NAME);
            return value != null && (value.equals(StageStatus.getSkippedForConditional()) ||
                                    value.equals(StageStatus.getSkippedForFailure()) ||
                                    value.equals(StageStatus.getSkippedForUnstable())
            );
        }
    }

    return false;
}
 
Example 2
Source File: PipelineNodeGraphVisitor.java    From blueocean-plugin with MIT License 5 votes vote down vote up
/**
 * Find any Actions on this node, and add them to the pipelineActions collection until we can attach
 * them to a FlowNodeWrapper.
 */
protected void accumulatePipelineActions(FlowNode node) {
    final List<Action> actions = node.getActions(Action.class);
    pipelineActions.addAll(actions);
    if (isNodeVisitorDumpEnabled) {
        dump(String.format("\t\taccumulating actions - added %d, total is %d", actions.size(), pipelineActions.size()));
    }
}
 
Example 3
Source File: PipelineNodeUtil.java    From blueocean-plugin with MIT License 5 votes vote down vote up
@CheckForNull
public static TagsAction getSyntheticStage(@Nullable FlowNode node){
    if(node != null) {
        for (Action action : node.getActions()) {
            if (action instanceof TagsAction && ((TagsAction) action).getTagValue(SyntheticStage.TAG_NAME) != null) {
                return (TagsAction) action;
            }
        }
    }
    return null;
}