diff --git a/src/main/java/io/iworkflow/core/WorkflowOptionBuilderExtension.java b/src/main/java/io/iworkflow/core/WorkflowOptionBuilderExtension.java index 376ffff..bcf4b75 100644 --- a/src/main/java/io/iworkflow/core/WorkflowOptionBuilderExtension.java +++ b/src/main/java/io/iworkflow/core/WorkflowOptionBuilderExtension.java @@ -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 this + * @param state The state to wait for completion. + * @return The builder. + */ + public WorkflowOptionBuilderExtension waitForCompletionState(Class 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 this + * @param states The states to wait for completion. * @return The builder. */ - public WorkflowOptionBuilderExtension waitForCompletionStates(Class ...states) { + @SafeVarargs + public final WorkflowOptionBuilderExtension waitForCompletionStates(Class... states) { Arrays.stream(states).forEach( state -> builder.addWaitForCompletionStateExecutionIds( WorkflowState.getStateExecutionId(state,1)