Class StartFlowOptions.Builder
- Enclosing class:
StartFlowOptions
StartFlowOptions values.-
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(Attribute<T> attribute, T value) Adds an initial Attribute value atomically with Flow start.addAttribute(AttributeMap<T> attributeMap, String instance, T value) Adds an initial Attribute-map value atomically with Flow start.build()Builds immutable start options from the current values.configOverride(FlowConfig value) Overrides Flow configuration for the new execution.idReusePolicy(IdReusePolicy value) Sets how an existing Flow ID may be reused.ignoreAlreadyStarted(boolean value) Controls whether an already-started response is accepted.Sets an idempotency key for this start request.retryPolicy(RetryPolicy value) Sets retry behavior for abnormal Flow completion.startDelay(Duration value) Delays creation of the first Step execution.Sets Dex's durable soft timeout for the Flow execution.Configures timeout-handler execution and selective state loading.timeoutPolicy(FlowTimeoutPolicy value) Sets the action taken when the positive Flow timeout expires.
-
Method Details
-
timeout
Sets Dex's durable soft timeout for the Flow execution.- Parameters:
value- a nonnegative whole-second timeout, ornullto disable it- Returns:
- this builder
-
timeoutPolicy
Sets the action taken when the positive Flow timeout expires.The default invokes an overridden
Flow.handleTimeout(Context); otherwise it fails the Flow. HANDLER is rejected before start when the target Flow has no override.- Parameters:
value- the non-null timeout policy- Returns:
- this builder
- Throws:
NullPointerException- ifvalueisnull
-
timeoutHandlerOptions
Configures timeout-handler execution and selective state loading.This option requires a positive timeout and a policy resolving to HANDLER.
- Parameters:
value- the handler options, ornullfor server defaults- Returns:
- this builder
-
startDelay
Delays creation of the first Step execution.- Parameters:
value- a nonnegative whole-second delay, ornullfor no explicit delay- Returns:
- this builder
-
idReusePolicy
Sets how an existing Flow ID may be reused.- Parameters:
value- the reuse policy; the default isIdReusePolicy.DEFAULT- Returns:
- this builder
-
retryPolicy
Sets retry behavior for abnormal Flow completion.- Parameters:
value- the Flow retry policy, ornullfor no explicit policy- Returns:
- this builder
-
addAttribute
Adds an initial Attribute value atomically with Flow start.- Type Parameters:
T- the Attribute value type- Parameters:
attribute- the nonnull registered Attributevalue- the typed initial value- Returns:
- this builder
- Throws:
NullPointerException- ifattributeisnull
-
addAttribute
public <T> StartFlowOptions.Builder addAttribute(AttributeMap<T> attributeMap, String instance, T value) Adds an initial Attribute-map value atomically with Flow start.- Type Parameters:
T- the Attribute value type- Parameters:
attributeMap- the nonnull registered Attribute mapinstance- the map instance. Slash is prohibited because it is a reserved charactervalue- the typed initial value- Returns:
- this builder
- Throws:
NullPointerException- ifattributeMapisnullIllegalArgumentException- ifinstanceisnull, blank, or contains/
-
configOverride
Overrides Flow configuration for the new execution.- Parameters:
value- the per-execution configuration, ornullfor defaults- Returns:
- this builder
-
ignoreAlreadyStarted
Controls whether an already-started response is accepted.When enabled, a start rejected because the Flow ID already exists returns the existing run ID only when
requestId(String)matches the request ID that started that run. A different or SDK-generated request ID still throwsFlowAlreadyStartedException. SeeStartFlowOptionsfor an example that sets both options.- Parameters:
value-trueto ignore the already-started error- Returns:
- this builder
-
requestId
Sets an idempotency key for this start request.A retried start returns the existing run only when
ignoreAlreadyStarted(boolean)istrueand this request ID matches the request that started that run. Without that option, the retry throwsFlowAlreadyStartedExceptioneven when the first attempt created the Flow. The match applies only when the ID reuse policy rejects the start. A policy that permits another run starts a new run instead. Dex compares only request IDs, not input or other options, so never reuse a request ID for a different logical start. SeeStartFlowOptionsfor an example that sets both options.- Parameters:
value- the stable request ID, ornullto generate a UUID- Returns:
- this builder
-
build
Builds immutable start options from the current values.- Returns:
- the configured start options
-