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 WorkflowImplementationOptions
build()
WorkflowImplementationOptions.Builder
setActivityOptions(java.util.Map<java.lang.String,ActivityOptions> activityOptions)
Set individual activity options per activityType.WorkflowImplementationOptions.Builder
setDefaultActivityOptions(ActivityOptions defaultActivityOptions)
These activity options have the lowest precedence across all activity options.WorkflowImplementationOptions.Builder
setDefaultLocalActivityOptions(LocalActivityOptions defaultLocalActivityOptions)
These local activity options have the lowest precedence across all local activity options.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).WorkflowImplementationOptions.Builder
setLocalActivityOptions(java.util.Map<java.lang.String,LocalActivityOptions> localActivityOptions)
Set individual local activity options per activityType.
-
-
-
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
TemporalFailure
or 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
Throwable
class 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.
-
build
public WorkflowImplementationOptions build()
-
-