Skip to content

Commit

Permalink
Add single waitForCompletionState to avoid warnings (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed Mar 8, 2024
1 parent 5d52f3d commit b640e6c
Showing 1 changed file with 15 additions and 2 deletions.
Expand Up @@ -11,10 +11,23 @@ public class WorkflowOptionBuilderExtension {

/**
* Add a state to wait for completion. This only waiting for the first completion of the state
* @param states The states to wait for completion. O
* NOTE: this will not be needed/required once server implements <a href="https://github.com/indeedeng/iwf/issues/349">this</a>
* @param state The state to wait for completion.
* @return The builder.
*/
public WorkflowOptionBuilderExtension waitForCompletionState(Class<? extends WorkflowState> state) {
this.waitForCompletionStates(state);
return this;
}

/**
* Add states to wait for completion. This only waiting for the first completion of the state
* NOTE: this will not be needed/required once server implements <a href="https://github.com/indeedeng/iwf/issues/349">this</a>
* @param states The states to wait for completion.
* @return The builder.
*/
public WorkflowOptionBuilderExtension waitForCompletionStates(Class<? extends WorkflowState> ...states) {
@SafeVarargs
public final WorkflowOptionBuilderExtension waitForCompletionStates(Class<? extends WorkflowState>... states) {
Arrays.stream(states).forEach(
state -> builder.addWaitForCompletionStateExecutionIds(
WorkflowState.getStateExecutionId(state,1)
Expand Down

0 comments on commit b640e6c

Please sign in to comment.