public StepEndNode(CpsFlowExecution exec, StepStartNode stepStartNode, List<FlowNode> parents) { super(exec, exec.iotaStr(), stepStartNode, parents); // we use SimpleXStreamFlowNodeStorage, which uses XStream, so // constructor call is always for brand-new FlowNode that has not existed anywhere. // such nodes always have empty actions setActions(Collections.<Action>emptyList()); }
public StepAtomNode(CpsFlowExecution exec, StepDescriptor d, FlowNode parent) { super(exec, exec.iotaStr(), parent); this.descriptorId = d!=null ? d.getId().intern() : null; // we use SimpleXStreamFlowNodeStorage, which uses XStream, so // constructor call is always for brand-new FlowNode that has not existed anywhere. // such nodes always have empty actions setActions(Collections.<Action>emptyList()); }
public StepStartNode(CpsFlowExecution exec, StepDescriptor d, FlowNode parent) { super(exec, exec.iotaStr(), parent); this.descriptor = d; this.descriptorId = d!=null ? d.getId().intern() : null; // we use SimpleXStreamFlowNodeStorage, which uses XStream, so // constructor call is always for brand-new FlowNode that has not existed anywhere. // such nodes always have empty actions setActions(Collections.<Action>emptyList()); }
this.heads = new TreeMap<Integer, FlowHead>(); heads.put(head.getId(), head); FlowStartNode start = new FlowStartNode(this, iotaStr()); head.newStartNode(start); FlowNode end = new FlowEndNode(this, iotaStr(), (FlowStartNode) startNodes.pop(), result, getCurrentHeads().toArray(new FlowNode[0])); end.addAction(new ErrorAction(failureReason)); head.setNewHead(end);
FlowNode head = new FlowEndNode(this, iotaStr(), (FlowStartNode)startNodes.pop(), result, getCurrentHeads().toArray(new FlowNode[0])); if (outcome.isFailure()) { head.addAction(new ErrorAction(outcome.getAbnormal()));
head.newStartNode(new FlowStartNode(this, iotaStr())); } catch (IOException e) { LOGGER.log(Level.FINE, "Failed to persist", e);
heads.put(h.getId(), h); h.newStartNode(new FlowStartNode(this, iotaStr()));
@Test /** Build okay but then the start nodes get screwed up */ public void inProgressButStartBlocksLost() throws Exception { final int[] build = new int[1]; story.thenWithHardShutdown( j -> { WorkflowRun run = runBasicPauseOnInput(j, DEFAULT_JOBNAME, build); CpsFlowExecution cpsExec = (CpsFlowExecution)(run.getExecution()); cpsExec.startNodes.push(new FlowStartNode(cpsExec, cpsExec.iotaStr())); run.save(); }); story.then( j->{ WorkflowJob r = j.jenkins.getItemByFullName(DEFAULT_JOBNAME, WorkflowJob.class); WorkflowRun run = r.getBuildByNumber(build[0]); assertCompletedCleanly(run); }); }