Package io.temporal.worker
Class WorkflowImplementationOptions.Builder
- java.lang.Object
-
- io.temporal.worker.WorkflowImplementationOptions.Builder
-
- Enclosing class:
- WorkflowImplementationOptions
public static final class WorkflowImplementationOptions.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowImplementationOptionsbuild()WorkflowImplementationOptions.BuildersetActivityOptions(java.util.Map<java.lang.String,ActivityOptions> activityOptions)Set individual activity options per activityType.WorkflowImplementationOptions.BuildersetDefaultActivityOptions(ActivityOptions defaultActivityOptions)These activity options have the lowest precedence across all activity options.WorkflowImplementationOptions.BuildersetDefaultLocalActivityOptions(LocalActivityOptions defaultLocalActivityOptions)These local activity options have the lowest precedence across all local activity options.WorkflowImplementationOptions.BuildersetDefaultNexusServiceOptions(NexusServiceOptions defaultNexusServiceOptions)These nexus service options to use if no specific options are passed for a service.WorkflowImplementationOptions.BuildersetFailWorkflowExceptionTypes(java.lang.Class<? extends java.lang.Throwable>... failWorkflowExceptionTypes)Optional: Sets how workflow worker deals with exceptions thrown from the workflow code which include non-deterministic history events (presumably arising from non-deterministic workflow definitions or non-backward compatible workflow definition changes).WorkflowImplementationOptions.BuildersetLocalActivityOptions(java.util.Map<java.lang.String,LocalActivityOptions> localActivityOptions)Set individual local activity options per activityType.WorkflowImplementationOptions.BuildersetNexusServiceOptions(java.util.Map<java.lang.String,NexusServiceOptions> nexusServiceOptions)Set individual Nexus Service options per service.
-
-
-
Method Detail
-
setFailWorkflowExceptionTypes
@SafeVarargs public final WorkflowImplementationOptions.Builder setFailWorkflowExceptionTypes(java.lang.Class<? extends java.lang.Throwable>... failWorkflowExceptionTypes)
Optional: Sets how workflow worker deals with exceptions thrown from the workflow code which include non-deterministic history events (presumably arising from non-deterministic workflow definitions or non-backward compatible workflow definition changes).The default behavior is to fail workflow on
TemporalFailureor any of its subclasses. Any other exceptions thrown from the workflow code are treated as bugs that can be fixed by a new deployment. So workflow is not failed, but it stuck in a retry loop trying to execute the code that led to the unexpected exception.This option allows to specify specific exception types which should lead to workflow failure instead of blockage. Any exception that extends the configured type considered matched. For example to fail workflow on any exception pass
Throwableclass to this method.
-
setActivityOptions
public WorkflowImplementationOptions.Builder setActivityOptions(java.util.Map<java.lang.String,ActivityOptions> activityOptions)
Set individual activity options per activityType. Will be merged with the map fromWorkflow.newActivityStub(Class, ActivityOptions, Map)which has the highest precedence.- Parameters:
activityOptions- map from activityType to ActivityOptions
-
setDefaultActivityOptions
public WorkflowImplementationOptions.Builder setDefaultActivityOptions(ActivityOptions defaultActivityOptions)
These activity options have the lowest precedence across all activity options. Will be overwritten entirely byWorkflow.newActivityStub(Class, ActivityOptions)and then by the individual activity options if any are set throughsetActivityOptions(Map)- Parameters:
defaultActivityOptions- ActivityOptions for all activities in the workflow.
-
setLocalActivityOptions
public WorkflowImplementationOptions.Builder setLocalActivityOptions(java.util.Map<java.lang.String,LocalActivityOptions> localActivityOptions)
Set individual local activity options per activityType. Will be merged with the map fromWorkflow.newLocalActivityStub(Class, LocalActivityOptions, Map)which has the highest precedence.- Parameters:
localActivityOptions- map from activityType to ActivityOptions
-
setDefaultLocalActivityOptions
public WorkflowImplementationOptions.Builder setDefaultLocalActivityOptions(LocalActivityOptions defaultLocalActivityOptions)
These local activity options have the lowest precedence across all local activity options. Will be overwritten entirely byWorkflow.newLocalActivityStub(Class, LocalActivityOptions)and then by the individual local activity options if any are set throughsetLocalActivityOptions(Map)- Parameters:
defaultLocalActivityOptions- ActivityOptions for all activities in the workflow.
-
setNexusServiceOptions
public WorkflowImplementationOptions.Builder setNexusServiceOptions(java.util.Map<java.lang.String,NexusServiceOptions> nexusServiceOptions)
Set individual Nexus Service options per service. Will be merged with the map fromWorkflow.newNexusServiceStub(Class, NexusServiceOptions)which has the highest precedence.- Parameters:
nexusServiceOptions- map from service to NexusServiceOptions
-
setDefaultNexusServiceOptions
public WorkflowImplementationOptions.Builder setDefaultNexusServiceOptions(NexusServiceOptions defaultNexusServiceOptions)
These nexus service options to use if no specific options are passed for a service. Will be used for a stub created withWorkflow.newNexusServiceStub(Class)- Parameters:
defaultNexusServiceOptions- default NexusServiceOptions for all services in the workflow.
-
build
public WorkflowImplementationOptions build()
-
-