Skip to content

Commit

Permalink
Merge pull request #94 from jglick/DefaultStepContext-FlowNode
Browse files Browse the repository at this point in the history
Just as DefaultStepContext makes FlowExecution available automatically, it should offer FlowNode
  • Loading branch information
dwnusbaum authored Apr 23, 2019
2 parents c0d800a + bbeb9c8 commit fbb3516
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -160,11 +162,13 @@ private <T> T castOrNull(Class<T> 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;

Expand Down

0 comments on commit fbb3516

Please sign in to comment.