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

Fix waitForWorkflow API for workflow with multiple thread results #230

Merged
merged 3 commits into from
Jul 20, 2024
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
13 changes: 8 additions & 5 deletions src/main/java/io/iworkflow/core/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,23 @@ private List<SearchAttribute> convertToSearchAttributeList(final Map<String, Sea
}

/**
* A long poll API to wait for the workflow completion
* A long poll API to wait for the workflow completion.
* Due to the limit of REST API, it will only wait for 30 seconds for the workflow to complete.
* (configurable in ClientOptions.LongPollApiMaxWaitTimeSeconds)
* If the workflow is not COMPLETED, throw the {@link WorkflowUncompletedException}.
*
* @param workflowId required, the workflowId
*/
public void waitForWorkflowCompletion(
final String workflowId) {
this.getSimpleWorkflowResultWithWait(Void.class, workflowId);
getComplexWorkflowResultWithWait(workflowId);
}

/**
* A long poll API to wait for the workflow completion
* For most cases, a workflow only has one result(one completion state).
* Use this API to retrieve the output of the state with waiting for the workflow to complete.
* A long poll API to wait for the workflow completion and return single result
* This only works for a workflow only has one result(one completion state).
* If the workflow has multiple completion states, use getComplexWorkflowResultWithWait.
* This API to retrieve the output of the state with waiting for the workflow to complete.
* If the workflow is not COMPLETED, throw the {@link WorkflowUncompletedException}.
*
* @param valueClass required, the type class of the output
Expand Down
Loading