Class SubFlowOptions.Builder
java.lang.Object
io.superdurable.dex.SubFlowOptions.Builder
- Enclosing class:
SubFlowOptions
Builds immutable SubFlow options.
A builder can be reused; each built value owns an immutable copy of its Attribute initializations.
-
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(Attribute<T> attribute, T value) Adds one initial static Attribute value to the SubFlow start.addAttribute(AttributeMap<T> attribute, String instance, T value) Adds one initial Attribute-map value to the SubFlow start.build()Builds immutable options.conditionId(String value) Sets the condition ID required byWait.anyCombinationOf(ConditionCombination...).configOverride(FlowConfig value) Overrides fields in the parent Flow's effective configuration for the SubFlow.retryPolicy(RetryPolicy value) Sets retry behavior for abnormal SubFlow completion.reusePolicy(SubFlowReusePolicy value) Sets how an execution already using the generated Flow ID is resolved.startDelay(Duration value) Sets the delay before the SubFlow starts.Sets Dex's durable soft timeout for the SubFlow execution.Configures timeout-handler execution and selective state loading.timeoutPolicy(FlowTimeoutPolicy value) Sets the action taken when the positive SubFlow timeout expires.
-
Method Details
-
timeout
Sets Dex's durable soft timeout for the SubFlow execution.- Parameters:
value- a nonnegative whole-second duration, ornullfor no explicit timeout- Returns:
- this builder
- Throws:
IllegalArgumentException- during condition mapping if the duration is unsupported
-
timeoutPolicy
Sets the action taken when the positive SubFlow timeout expires.The default invokes the target Flow's overridden
Flow.handleTimeout(Context); otherwise it fails the SubFlow. HANDLER requires that 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
Sets the delay before the SubFlow starts.- Parameters:
value- a nonnegative whole-second duration, ornullfor no explicit delay- Returns:
- this builder
- Throws:
IllegalArgumentException- during condition mapping if the duration is unsupported
-
retryPolicy
Sets retry behavior for abnormal SubFlow completion.- Parameters:
value- the Flow retry policy, ornullfor no explicit policy- Returns:
- this builder
-
addAttribute
Adds one initial static Attribute value to the SubFlow start.- Type Parameters:
T- the Attribute value type- Parameters:
attribute- an Attribute registered by the target SubFlowvalue- the initial value, includingnullwhen supported by its value type- Returns:
- this builder
- Throws:
NullPointerException- ifattributeisnull
-
addAttribute
Adds one initial Attribute-map value to the SubFlow start.- Type Parameters:
T- the Attribute value type- Parameters:
attribute- an Attribute map registered by the target SubFlowinstance- the map instance. Slash is prohibited because it is a reserved charactervalue- the initial value, includingnullwhen supported by its value type- Returns:
- this builder
- Throws:
NullPointerException- ifattributeisnullIllegalArgumentException- ifinstanceis blank or contains/
-
configOverride
Overrides fields in the parent Flow's effective configuration for the SubFlow.- Parameters:
value- the partial Flow configuration, ornullfor no overrides- Returns:
- this builder
-
reusePolicy
Sets how an execution already using the generated Flow ID is resolved.- Parameters:
value- the non-null reuse policy- Returns:
- this builder
- Throws:
NullPointerException- ifvalueisnull
-
conditionId
Sets the condition ID required byWait.anyCombinationOf(ConditionCombination...).- Parameters:
value- the stable condition ID, ornulloutside any-combination waits- Returns:
- this builder
- Throws:
InvalidStepResultException- during condition mapping if the ID is empty or duplicates another condition
-
build
-