Class StepOptions.Builder
- Enclosing class:
StepOptions
StepOptions values.-
Method Summary
Modifier and TypeMethodDescriptionaddExecuteLoadAttributeMap(AttributeMap<?> value) Loads every current instance of an AttributeMap for Execute.addExecuteLoadAttributeMapInstance(AttributeMap<?> value, String instance) Loads one AttributeMap instance for Execute.addExecuteLoadChannel(Channel<?> value) Loads pending messages from one Channel for Execute.addExecuteLoadChannelMap(ChannelMap<?> value) Loads pending messages from every current ChannelMap instance for Execute.addExecuteLoadChannelMapInstance(ChannelMap<?> value, String instance) Loads pending messages from one ChannelMap instance for Execute.addExecuteLock(AttributeLock value) Adds an Attribute lock held while the execute method runs.addWaitForLoadAttributeMap(AttributeMap<?> value) Loads every current instance of an AttributeMap for WaitFor.addWaitForLoadAttributeMapInstance(AttributeMap<?> value, String instance) Loads one AttributeMap instance for WaitFor.addWaitForLoadChannel(Channel<?> value) Loads pending messages from one Channel for WaitFor.addWaitForLoadChannelMap(ChannelMap<?> value) Loads pending messages from every current instance of a ChannelMap for WaitFor.addWaitForLoadChannelMapInstance(ChannelMap<?> value, String instance) Loads pending messages from one ChannelMap instance for WaitFor.addWaitForLock(AttributeLock value) Adds an Attribute lock held while the wait-for method runs.build()Builds immutable Step options from the current values.executeDurability(StepDurability value) Overrides durability for this Step's execute method result.executeMethodTimeout(Duration value) Sets the maximum duration of one execute method attempt.executeRetry(RetryPolicy value) Sets the retry policy for execute method failures.heartbeatTimeout(Duration value) Sets the heartbeat timeout for regular wait-for and execute activities.onExecuteFailureProceedTo(Class<? extends Step<I>> stepClass) Continues to a recovery Step after execute retries are exhausted.onExecuteFailureProceedTo(Class<? extends Step<I>> stepClass, StepOptions options) Continues to a recovery Step with per-execution options after execute retries fail.waitForDurability(StepDurability value) Overrides durability for this Step's wait-for method result.Sets the action taken after wait-for retries are exhausted.waitForMethodTimeout(Duration value) Sets the maximum duration of one wait-for method attempt.waitForRetry(RetryPolicy value) Sets the retry policy for wait-for method failures.
-
Method Details
-
waitForMethodTimeout
Sets the maximum duration of one wait-for method attempt.A regular activity attempt defaults to two hours. An asynchronous local activity ignores this setting during its seven-second optimization window; fallback regular activity attempts apply it.
- Parameters:
value- the method timeout, ornullfor the server default- Returns:
- this builder
-
executeMethodTimeout
Sets the maximum duration of one execute method attempt.A regular activity attempt defaults to two hours. An asynchronous local activity ignores this setting during its seven-second optimization window; fallback regular activity attempts apply it.
- Parameters:
value- the method timeout, ornullfor the server default- Returns:
- this builder
-
heartbeatTimeout
Sets the heartbeat timeout for regular wait-for and execute activities.Dex sends no automatic heartbeat. Application code must call
Context.recordHeartbeat(Object)or write aStreamoften enough to make progress.nullandDuration.ZEROuse the one-minute server default. Explicit values must be whole seconds within the signed int32 range and satisfy the server-configured minimum, which defaults to ten seconds. Local activities ignore this setting; a fallback regular activity applies it. Once cancellation reaches the Java Worker, Dex interrupts the handler thread.- Parameters:
value- the regular activity heartbeat timeout, ornullfor one minute- Returns:
- this builder
-
waitForRetry
Sets the retry policy for wait-for method failures.- Parameters:
value- the retry policy, ornullfor the server default- Returns:
- this builder
-
executeRetry
Sets the retry policy for execute method failures.- Parameters:
value- the retry policy, ornullfor the server default- Returns:
- this builder
-
waitForFailure
Sets the action taken after wait-for retries are exhausted.This policy does not change durability selection. The method override takes precedence over
FlowConfig's default, followed by the synchronous server default.- Parameters:
value- the failure policy; the default isWaitForFailurePolicy.FAIL_FLOW- Returns:
- this builder
-
onExecuteFailureProceedTo
Continues to a recovery Step after execute retries are exhausted.The recovery Step receives
nullinput. Its input type should therefore acceptnull, commonlyVoid.This policy does not change durability selection. The method override takes precedence over
FlowConfig's default, followed by the synchronous server default.- Type Parameters:
I- the recovery Step input type- Parameters:
stepClass- the nonnull recovery Step class- Returns:
- this builder
- Throws:
NullPointerException- ifstepClassisnull
-
onExecuteFailureProceedTo
public <I> StepOptions.Builder onExecuteFailureProceedTo(Class<? extends Step<I>> stepClass, StepOptions options) Continues to a recovery Step with per-execution options after execute retries fail.The same durability guidance as
onExecuteFailureProceedTo(Class)applies. Theoptionsparameter configures the recovery Step execution; configure the failing Step's execute durability on the builder receiving this method call.- Type Parameters:
I- the recovery Step input type- Parameters:
stepClass- the nonnull recovery Step classoptions- recovery execution options, ornullfor the Step defaults- Returns:
- this builder
- Throws:
NullPointerException- ifstepClassisnull
-
waitForDurability
Overrides durability for this Step's wait-for method result.This method-level value takes precedence over
FlowConfig's default and the synchronous server default. Failure policy does not alter that ordering. SeeStepDurabilityfor the asynchronous replay tradeoff.- Parameters:
value- the durability mode; the default isStepDurability.DEFAULT- Returns:
- this builder
-
executeDurability
Overrides durability for this Step's execute method result.This method-level value takes precedence over
FlowConfig's default and the synchronous server default. Failure policy does not alter that ordering. SeeStepDurabilityfor the asynchronous replay tradeoff.- Parameters:
value- the durability mode; the default isStepDurability.DEFAULT- Returns:
- this builder
-
addWaitForLock
Adds an Attribute lock held while the wait-for method runs.- Parameters:
value- the lock definition- Returns:
- this builder
-
addExecuteLock
Adds an Attribute lock held while the execute method runs.- Parameters:
value- the lock definition- Returns:
- this builder
-
addWaitForLoadAttributeMap
Loads every current instance of an AttributeMap for WaitFor.- Parameters:
value- an AttributeMap registered by the Step's Flow- Returns:
- this builder
- Throws:
NullPointerException- during mapping ifvalueisnull
-
addWaitForLoadAttributeMapInstance
public StepOptions.Builder addWaitForLoadAttributeMapInstance(AttributeMap<?> value, String instance) Loads one AttributeMap instance for WaitFor.- Parameters:
value- an AttributeMap registered by the Step's Flowinstance- the slash-free instance key- Returns:
- this builder
-
addWaitForLoadChannel
Loads pending messages from one Channel for WaitFor.- Parameters:
value- a Channel registered by the Step's Flow- Returns:
- this builder
-
addWaitForLoadChannelMap
Loads pending messages from every current instance of a ChannelMap for WaitFor.- Parameters:
value- a ChannelMap registered by the Step's Flow- Returns:
- this builder
-
addWaitForLoadChannelMapInstance
Loads pending messages from one ChannelMap instance for WaitFor.- Parameters:
value- a ChannelMap registered by the Step's Flowinstance- the slash-free instance key- Returns:
- this builder
-
addExecuteLoadAttributeMap
Loads every current instance of an AttributeMap for Execute.- Parameters:
value- an AttributeMap registered by the Step's Flow- Returns:
- this builder
-
addExecuteLoadAttributeMapInstance
public StepOptions.Builder addExecuteLoadAttributeMapInstance(AttributeMap<?> value, String instance) Loads one AttributeMap instance for Execute.- Parameters:
value- an AttributeMap registered by the Step's Flowinstance- the slash-free instance key- Returns:
- this builder
-
addExecuteLoadChannel
Loads pending messages from one Channel for Execute.- Parameters:
value- a Channel registered by the Step's Flow- Returns:
- this builder
-
addExecuteLoadChannelMap
Loads pending messages from every current ChannelMap instance for Execute.- Parameters:
value- a ChannelMap registered by the Step's Flow- Returns:
- this builder
-
addExecuteLoadChannelMapInstance
Loads pending messages from one ChannelMap instance for Execute.- Parameters:
value- a ChannelMap registered by the Step's Flowinstance- the slash-free instance key- Returns:
- this builder
-
build
Builds immutable Step options from the current values.- Returns:
- the configured Step options
-