public String getDisplayName() { StepDescriptor d = getStepDescriptor(); return d!=null ? d.getDisplayName() : stepDescriptorId; }
/** * Given a list of {@link CpsThread}s that share the same {@link FlowHead}, in the order * from outer to inner, reconstruct the thread stack. */ private ThreadInfo(List<CpsThread> e) { CpsThread head = e.get(e.size() - 1); headline = "Thread #" + head.id; ListIterator<CpsThread> itr = e.listIterator(e.size()); while (itr.hasPrevious()) { CpsThread t = itr.previous(); StepExecution s = t.getStep(); if (s !=null) { StepDescriptor d = ((CpsStepContext) s.getContext()).getStepDescriptor(); if (d != null) { String status = s.getStatusBounded(3, TimeUnit.SECONDS); if (status != null) { stack.add(new StackTraceElement("DSL", d.getFunctionName(), status, -1)); } else { stack.add(new StackTraceElement("DSL", d.getFunctionName(), null, -2)); } } } stack.addAll(t.getStackTrace()); } }
private static List<String> stepNames(ListenableFuture<List<StepExecution>> executionsFuture) throws Exception { List<String> r = new ArrayList<String>(); for (StepExecution e : executionsFuture.get()) { // TODO should this method be defined in StepContext? StepDescriptor d = ((CpsStepContext) e.getContext()).getStepDescriptor(); assertNotNull(d); r.add(d.getFunctionName()); } return r; }
/** * Inserts the flow node that indicates the beginning of the body invocation. * * @see #addBodyEndFlowNode() */ private @Nonnull StepStartNode addBodyStartFlowNode(FlowHead head) { CpsFlowExecution.maybeAutoPersistNode(head.get()); StepStartNode start = new StepStartNode(head.getExecution(), context.getStepDescriptor(), head.get()); head.getExecution().cacheNode(start); this.startNodeId = start.getId(); start.addAction(new BodyInvocationAction()); return start; }