1919import jenkins .util .Timer ;
2020import org .jenkinsci .plugins .workflow .cps .nodes .StepStartNode ;
2121import org .jenkinsci .plugins .workflow .flow .FlowExecution ;
22- import org .jenkinsci .plugins .workflow .graph .FlowGraphWalker ;
2322import org .jenkinsci .plugins .workflow .graph .FlowNode ;
23+ import org .jenkinsci .plugins .workflow .graphanalysis .DepthFirstScanner ;
2424import org .jenkinsci .plugins .workflow .job .WorkflowRun ;
2525import org .jenkinsci .plugins .workflow .steps .StepDescriptor ;
2626import org .jenkinsci .plugins .workflow .support .actions .WorkspaceActionImpl ;
@@ -62,6 +62,12 @@ public Computer getComputer() {
6262 return computer ;
6363 }
6464
65+ public RunListTable getHandler () {
66+ RunListTable runListTable = new RunListTable ();
67+ runListTable .setRuns (getExecutions ());
68+ return runListTable ;
69+ }
70+
6571 private static void load (Computer computer ) {
6672 Set <AgentExecution > executions = agentExecutions .get (computer );
6773 Node node = computer .getNode ();
@@ -80,19 +86,15 @@ private static void load(Computer computer) {
8086 if (flowExecution != null ) {
8187 AgentExecution execution = new AgentExecution (wfr );
8288 boolean matchesNode = false ;
83- FlowGraphWalker walker = new FlowGraphWalker (flowExecution );
84- for (FlowNode flowNode : walker ) {
85- if (flowNode instanceof StepStartNode ) {
89+ for (FlowNode flowNode : new DepthFirstScanner ().allNodes (flowExecution )) {
90+ for (WorkspaceActionImpl action : flowNode .getActions (WorkspaceActionImpl .class )) {
8691 StepStartNode startNode = (StepStartNode ) flowNode ;
8792 StepDescriptor descriptor = startNode .getDescriptor ();
8893 if (descriptor instanceof ExecutorStep .DescriptorImpl ) {
89- WorkspaceActionImpl action = flowNode .getAction (WorkspaceActionImpl .class );
90- if (action != null ) {
91- String nodeName = action .getNode ();
92- if (node .getNodeName ().equals (nodeName )) {
93- matchesNode = true ;
94- execution .addFlowNode (flowNode );
95- }
94+ String nodeName = action .getNode ();
95+ if (node .getNodeName ().equals (nodeName )) {
96+ matchesNode = true ;
97+ execution .addFlowNode (flowNode );
9698 }
9799 }
98100 }
0 commit comments