-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add getCurrentUpdateInfo #2158
Add getCurrentUpdateInfo #2158
Conversation
6a29409
to
be38203
Compare
* <p>Note: Should only be called within the context of a workflow. | ||
* | ||
* @return current workflow info. | ||
*/ | ||
public static WorkflowInfo getInfo() { | ||
return WorkflowInternal.getWorkflowInfo(); | ||
} | ||
|
||
/** | ||
* Returns information about current workflow update. | ||
* | ||
* <p>Note: Should only be called within the context of a update handler thread in a workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might change both of these notes to "only returns non-null / filled option within the context.."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They actually throw an error if called outside a workflow context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok, even better to say that then
@Override | ||
public String update(Integer index, String value) { | ||
UpdateInfo updateInfo = Workflow.getCurrentUpdateInfo().get(); | ||
Workflow.sleep(Duration.ofMillis(100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the sleep matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not for the test. I was thinking making the handler take more then one WFT would provide better coverage. Not sure if that is really true though.
d60d99a
to
9ae2781
Compare
9ae2781
to
22a2ba9
Compare
Add
getCurrentUpdateInfo()
.closes #2093