sdk-java
sdk-java copied to clipboard
Add ability to complete workflow from any line
Is your feature request related to a problem? Please describe. Currently the only way to complete or fail a workflow is through completing (or throwing exception) from the method annotated with @WorkflowMethod. Sometimes it is convinient to complete or fail workflow from some other function or even thread.
Describe the solution you'd like An API to complete workflow from any place. Strawman:
Workflow.complete(result);
Workflow.fail(Exception);
Describe alternatives you've considered Do not introduce this API and rely on completion of main workflow method.l
Additional context This feature is based on a customer request.
Similar request: https://community.temporal.io/t/fail-workflow-form-updatemethod/11441