Package com.uber.cadence.client
Class WorkflowOptions.Builder
- java.lang.Object
-
- com.uber.cadence.client.WorkflowOptions.Builder
-
- Enclosing class:
- WorkflowOptions
public static final class WorkflowOptions.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(WorkflowOptions o)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowOptions
build()
WorkflowOptions.Builder
setContextPropagators(java.util.List<ContextPropagator> contextPropagators)
Specifies the list of context propagators to use during this workflow.WorkflowOptions.Builder
setCronSchedule(java.lang.String cronSchedule)
WorkflowOptions.Builder
setDelayStart(java.time.Duration delayStart)
WorkflowOptions.Builder
setExecutionStartToCloseTimeout(java.time.Duration executionStartToCloseTimeout)
The time after which workflow execution is automatically terminated by Cadence service.WorkflowOptions.Builder
setMemo(java.util.Map<java.lang.String,java.lang.Object> memo)
Specifies additional non-indexed information in result of list workflow.WorkflowOptions.Builder
setRetryOptions(RetryOptions retryOptions)
WorkflowOptions.Builder
setSearchAttributes(java.util.Map<java.lang.String,java.lang.Object> searchAttributes)
Specifies additional indexed information in result of list workflow.WorkflowOptions.Builder
setTaskList(java.lang.String taskList)
Task list to use for decision tasks.WorkflowOptions.Builder
setTaskStartToCloseTimeout(java.time.Duration taskStartToCloseTimeout)
Maximum execution time of a single decision task.WorkflowOptions.Builder
setWorkflowId(java.lang.String workflowId)
Workflow id to use when starting.WorkflowOptions.Builder
setWorkflowIdReusePolicy(WorkflowIdReusePolicy workflowIdReusePolicy)
Specifies server behavior if a completed workflow with the same id exists.WorkflowOptions
validateBuildWithDefaults()
Validates that all required properties are set and fills all other with default parameters.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(WorkflowOptions o)
-
-
Method Detail
-
setWorkflowId
public WorkflowOptions.Builder setWorkflowId(java.lang.String workflowId)
Workflow id to use when starting. If not specified a UUID is generated. Note that it is dangerous as in case of client side retries no deduplication will happen based on the generated id. So prefer assigning business meaningful ids if possible.
-
setWorkflowIdReusePolicy
public WorkflowOptions.Builder setWorkflowIdReusePolicy(WorkflowIdReusePolicy workflowIdReusePolicy)
Specifies server behavior if a completed workflow with the same id exists. Note that under no conditions Cadence allows two workflows with the same domain and workflow id run simultaneously.-
AllowDuplicateFailedOnly is a default value. It means that workflow can start if
previous run failed or was cancelled or terminated.
-
AllowDuplicate allows new run independently of the previous run closure status.
-
RejectDuplicate doesn't allow new run independently of the previous run closure status.
-
TerminateIfRunning terminate current running workflow using the same workflow ID if exist,
then start a new run in one transaction
-
setExecutionStartToCloseTimeout
public WorkflowOptions.Builder setExecutionStartToCloseTimeout(java.time.Duration executionStartToCloseTimeout)
The time after which workflow execution is automatically terminated by Cadence service. Do not rely on execution timeout for business level timeouts. It is preferred to use in workflow timers for this purpose.
-
setTaskStartToCloseTimeout
public WorkflowOptions.Builder setTaskStartToCloseTimeout(java.time.Duration taskStartToCloseTimeout)
Maximum execution time of a single decision task. Default is 10 seconds. Maximum accepted value is 60 seconds.
-
setTaskList
public WorkflowOptions.Builder setTaskList(java.lang.String taskList)
Task list to use for decision tasks. It should match a task list specified when creating aWorker
that hosts the workflow code.
-
setRetryOptions
public WorkflowOptions.Builder setRetryOptions(RetryOptions retryOptions)
-
setCronSchedule
public WorkflowOptions.Builder setCronSchedule(java.lang.String cronSchedule)
-
setMemo
public WorkflowOptions.Builder setMemo(java.util.Map<java.lang.String,java.lang.Object> memo)
Specifies additional non-indexed information in result of list workflow. The type of value can be any object that are serializable byDataConverter
-
setSearchAttributes
public WorkflowOptions.Builder setSearchAttributes(java.util.Map<java.lang.String,java.lang.Object> searchAttributes)
Specifies additional indexed information in result of list workflow. The type of value should be basic type such as: String, Integer, Boolean, Double,LocalDateTime
-
setContextPropagators
public WorkflowOptions.Builder setContextPropagators(java.util.List<ContextPropagator> contextPropagators)
Specifies the list of context propagators to use during this workflow.
-
setDelayStart
public WorkflowOptions.Builder setDelayStart(java.time.Duration delayStart)
-
build
public WorkflowOptions build()
-
validateBuildWithDefaults
public WorkflowOptions validateBuildWithDefaults()
Validates that all required properties are set and fills all other with default parameters.
-
-