Skip to content

Commit

Permalink
add start delay (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
duoertai committed Mar 22, 2024
1 parent dc66ac7 commit 71bc52d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id "org.openapi.generator" version "6.0.1"
id "org.openapi.generator" version "6.6.0"
id 'org.springframework.boot' version '2.7.2'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
Expand Down
2 changes: 1 addition & 1 deletion iwf-idl
1 change: 1 addition & 0 deletions src/main/java/io/iworkflow/core/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public String startWorkflow(
if (options != null) {
unregisterWorkflowOptions.workflowIdReusePolicy(options.getWorkflowIdReusePolicy());
unregisterWorkflowOptions.cronSchedule(options.getCronSchedule());
unregisterWorkflowOptions.workflowStartDelaySeconds(options.getWorkflowStartDelaySeconds());
unregisterWorkflowOptions.workflowRetryPolicy(options.getWorkflowRetryPolicy());
unregisterWorkflowOptions.workflowConfigOverride(options.getWorkflowConfigOverride());
unregisterWorkflowOptions.waitForCompletionStateExecutionIds(options.getWaitForCompletionStateExecutionIds());
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/io/iworkflow/core/UnregisteredClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public String startWorkflow(
if (options.getCronSchedule().isPresent()) {
startOptions.cronSchedule(CronScheduleValidator.validate(options.getCronSchedule()));
}
if (options.getWorkflowStartDelaySeconds().isPresent()) {
startOptions.workflowStartDelaySeconds(options.getWorkflowStartDelaySeconds().get());
}
if (options.getWorkflowIdReusePolicy().isPresent()) {
startOptions.idReusePolicy(options.getWorkflowIdReusePolicy().get());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public abstract class UnregisteredWorkflowOptions {

public abstract Optional<String> getCronSchedule();

public abstract Optional<Integer> getWorkflowStartDelaySeconds();

public abstract Optional<WorkflowRetryPolicy> getWorkflowRetryPolicy();

public abstract Optional<WorkflowStateOptions> getStartStateOptions();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/iworkflow/core/WorkflowOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public abstract class WorkflowOptions {

public abstract Optional<String> getCronSchedule();

public abstract Optional<Integer> getWorkflowStartDelaySeconds();

public abstract Optional<WorkflowRetryPolicy> getWorkflowRetryPolicy();

public abstract Map<String, Object> getInitialSearchAttribute();
Expand Down

0 comments on commit 71bc52d

Please sign in to comment.