/** * Inserts the flow node that indicates the beginning of the body invocation. * * @see #addBodyStartFlowNode(FlowHead) */ private @Nonnull StepEndNode addBodyEndFlowNode() { try { FlowHead head = CpsThread.current().head; StepEndNode end = new StepEndNode(head.getExecution(), getBodyStartNode(), head.get()); head.getExecution().cacheNode(end); end.addAction(new BodyInvocationAction()); head.setNewHead(end); return end; } catch (IOException e) { LOGGER.log(WARNING, "Failed to grow the flow graph", e); throw new Error(e); } }
if (heads != null) { FlowHead first = getFirstHead(); first.setNewHead(head); done = true; // After setting the final head heads.clear();
thread.head.setNewHead(an); thread.head.setNewHead(new StepEndNode(exec, (StepStartNode)an, an));
g.getExecution().subsumeHead(parents.get(i)); StepEndNode en = new StepEndNode(flow, (StepStartNode) n, parents); thread.head.setNewHead(en);
@Override public Next receive(Object o) { if (!isLaunched()) { // failed before we even started. fake the start node that start() would have created. FlowHead h = CpsThread.current().head; StepStartNode ssn = addBodyStartFlowNode(h); h.setNewHead(ssn); } StepEndNode en = addBodyEndFlowNode(); Throwable t = (Throwable)o; en.addAction(new ErrorAction(t)); CpsFlowExecution.maybeAutoPersistNode(en); setOutcome(new Outcome(null,t)); StepContext sc = new CpsBodySubContext(context, en); for (BodyExecutionCallback c : callbacks) { c.onFailure(sc, t); } synchronized (CpsBodyExecution.this) { thread.popContextVariables(); } return Next.terminate(null); }