Skip to content

Commit

Permalink
Fix waitForWorkflow API for workflow with multiple thread results (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Jul 20, 2024
1 parent 56ef8d0 commit 1f9f8be
Showing 1 changed file with 8 additions and 5 deletions.
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

0 comments on commit 1f9f8be

Please sign in to comment.