@Override public boolean start() throws Exception { if (getContext().hasBody()) { // recommended mode if (step.concurrency != null) { throw new AbortException(Messages.StageStepExecution_concurrency_not_supported_in_block_mode()); } getContext().newBodyInvoker().withCallback(BodyExecutionCallback.wrap(getContext())).withDisplayName(step.name).start(); return false; } getContext().get(TaskListener.class).getLogger().println(Messages.StageStepExecution_non_block_mode_deprecated()); if (isInsideParallel(node)) { throw new AbortException(Messages.StageStepExecution_the_stage_step_must_not_be_used_inside_a()); } node.addAction(new LabelAction(step.name)); node.addAction(new StageActionImpl(step.name)); enter(run, getContext(), step.name, step.concurrency); return false; // execute asynchronously }
@Override public boolean start() throws Exception { TaskAction taskAction = new TaskActionImpl(node, step.name); StepContext context = this.getContext(); if (context.hasBody()) { ((CpsBodyInvoker) context.newBodyInvoker()) .withStartAction(taskAction) .withCallback(new TaskBodyExecutionWrapper(taskAction, context)) .withDisplayName(step.name).start(); } else { LOG.warning("Task pipeline step without body is deprecated and " + "may be subject for removal in a future release"); node.addAction(taskAction); getContext().onSuccess(null); } node.addAction(new LabelAction(step.name)); if (node.getAction(TimingAction.class) == null) { node.addAction(new TimingAction()); } return false; }