diff --git a/iwf-idl b/iwf-idl index d1da138..343c403 160000 --- a/iwf-idl +++ b/iwf-idl @@ -1 +1 @@ -Subproject commit d1da1384bca0c9317b916df3d6bbd3b848dc5150 +Subproject commit 343c403214e66fb9878a1ea873d954731129b0d6 diff --git a/src/main/java/io/iworkflow/core/Client.java b/src/main/java/io/iworkflow/core/Client.java index 423ff07..9d497da 100644 --- a/src/main/java/io/iworkflow/core/Client.java +++ b/src/main/java/io/iworkflow/core/Client.java @@ -138,6 +138,7 @@ public String startWorkflow( unregisterWorkflowOptions.workflowConfigOverride(options.getWorkflowConfigOverride()); unregisterWorkflowOptions.waitForCompletionStateExecutionIds(options.getWaitForCompletionStateExecutionIds()); unregisterWorkflowOptions.waitForCompletionStateIds(options.getWaitForCompletionStateIds()); + unregisterWorkflowOptions.workflowAlreadyStartedOptions(options.getWorkflowAlreadyStartedOptions()); final Map saTypes = registry.getSearchAttributeKeyToTypeMap(wfType); final List convertedSAs = convertToSearchAttributeList(saTypes, options.getInitialSearchAttribute()); diff --git a/src/main/java/io/iworkflow/core/UnregisteredClient.java b/src/main/java/io/iworkflow/core/UnregisteredClient.java index 6eaf118..27483a2 100644 --- a/src/main/java/io/iworkflow/core/UnregisteredClient.java +++ b/src/main/java/io/iworkflow/core/UnregisteredClient.java @@ -12,6 +12,7 @@ import io.iworkflow.gen.models.PersistenceLoadingPolicy; import io.iworkflow.gen.models.SearchAttributeKeyAndType; import io.iworkflow.gen.models.StateCompletionOutput; +import io.iworkflow.gen.models.WorkflowAlreadyStartedOptions; import io.iworkflow.gen.models.WorkflowGetDataObjectsRequest; import io.iworkflow.gen.models.WorkflowGetDataObjectsResponse; import io.iworkflow.gen.models.WorkflowGetRequest; @@ -170,6 +171,10 @@ public String startWorkflow( startOptions.useMemoForDataAttributes(options.getUsingMemoForDataAttributes().get()); } + if (options.getWorkflowAlreadyStartedOptions().isPresent()) { + startOptions.workflowAlreadyStartedOptions(options.getWorkflowAlreadyStartedOptions().get()); + } + request.workflowStartOptions(startOptions); request.waitForCompletionStateExecutionIds(options.getWaitForCompletionStateExecutionIds()); diff --git a/src/main/java/io/iworkflow/core/UnregisteredWorkflowOptions.java b/src/main/java/io/iworkflow/core/UnregisteredWorkflowOptions.java index 11419a2..f9f85ed 100644 --- a/src/main/java/io/iworkflow/core/UnregisteredWorkflowOptions.java +++ b/src/main/java/io/iworkflow/core/UnregisteredWorkflowOptions.java @@ -2,6 +2,7 @@ import io.iworkflow.gen.models.IDReusePolicy; import io.iworkflow.gen.models.SearchAttribute; +import io.iworkflow.gen.models.WorkflowAlreadyStartedOptions; import io.iworkflow.gen.models.WorkflowConfig; import io.iworkflow.gen.models.WorkflowRetryPolicy; import io.iworkflow.gen.models.WorkflowStateOptions; @@ -31,4 +32,6 @@ public abstract class UnregisteredWorkflowOptions { public abstract List getWaitForCompletionStateExecutionIds(); public abstract List getWaitForCompletionStateIds(); + + public abstract Optional getWorkflowAlreadyStartedOptions(); } diff --git a/src/main/java/io/iworkflow/core/WorkflowOptions.java b/src/main/java/io/iworkflow/core/WorkflowOptions.java index e97773d..3cd7d73 100644 --- a/src/main/java/io/iworkflow/core/WorkflowOptions.java +++ b/src/main/java/io/iworkflow/core/WorkflowOptions.java @@ -1,6 +1,7 @@ package io.iworkflow.core; import io.iworkflow.gen.models.IDReusePolicy; +import io.iworkflow.gen.models.WorkflowAlreadyStartedOptions; import io.iworkflow.gen.models.WorkflowConfig; import io.iworkflow.gen.models.WorkflowRetryPolicy; import org.immutables.value.Value; @@ -26,6 +27,8 @@ public abstract class WorkflowOptions { public abstract List getWaitForCompletionStateIds(); public abstract List getWaitForCompletionStateExecutionIds(); + public abstract Optional getWorkflowAlreadyStartedOptions(); + public static WorkflowOptionBuilderExtension extendedBuilder() { return new WorkflowOptionBuilderExtension(); }