Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just as DefaultStepContext makes FlowExecution available automatically, it should offer FlowNode #94

Merged
merged 1 commit into from
Apr 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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