diff --git a/src/main/java/org/jenkinsci/plugins/workflow/support/DefaultStepContext.java b/src/main/java/org/jenkinsci/plugins/workflow/support/DefaultStepContext.java index 7ca30432..4ccdbcc4 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/support/DefaultStepContext.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/support/DefaultStepContext.java @@ -95,6 +95,8 @@ public abstract class DefaultStepContext extends StepContext { return castOrNull(key, get(Run.class).getParent()); } else if (FlowExecution.class.isAssignableFrom(key)) { return castOrNull(key,getExecution()); + } else if (FlowNode.class.isAssignableFrom(key)) { + return castOrNull(key, getNode()); } else { // unrecognized key return null; @@ -160,11 +162,13 @@ private T castOrNull(Class key, Object o) { /** * Finds the associated execution. + * Automatically available from {@link #get}. */ protected abstract @Nonnull FlowExecution getExecution() throws IOException; /** * Finds the associated node. + * Automatically available from {@link #get}. */ protected abstract @Nonnull FlowNode getNode() throws IOException;