Package io.temporal.internal.replay
Interface WorkflowContext
-
public interface WorkflowContext
Core top level workflow context
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<ContextPropagator>
getContextPropagators()
<R> R
getLastCompletionResult(java.lang.Class<R> resultClass, java.lang.reflect.Type resultType)
java.util.Map<java.lang.String,java.lang.Object>
getPropagatedContexts()
Returns all current contexts being propagated by aContextPropagator
.ReplayWorkflowContext
getReplayContext()
WorkflowImplementationOptions
getWorkflowImplementationOptions()
io.temporal.api.failure.v1.Failure
mapWorkflowExceptionToFailure(java.lang.Throwable exception)
Convert exception to the serialized Failure that can be reported to the server.
This method is needed when framework code needs to serialize aTemporalFailure
instance with details object produced by the application code.
The framework code is not aware of DataConverter so this is working around this layering.
-
-
-
Method Detail
-
getReplayContext
ReplayWorkflowContext getReplayContext()
-
mapWorkflowExceptionToFailure
io.temporal.api.failure.v1.Failure mapWorkflowExceptionToFailure(java.lang.Throwable exception)
Convert exception to the serialized Failure that can be reported to the server.
This method is needed when framework code needs to serialize aTemporalFailure
instance with details object produced by the application code.
The framework code is not aware of DataConverter so this is working around this layering.- Parameters:
exception
- throwable to convert- Returns:
- Serialized failure
-
getWorkflowImplementationOptions
@Nonnull WorkflowImplementationOptions getWorkflowImplementationOptions()
-
getLastCompletionResult
@Nullable <R> R getLastCompletionResult(java.lang.Class<R> resultClass, java.lang.reflect.Type resultType)
- Returns:
- Deserialized completion result of the last cron workflow run
-
getContextPropagators
java.util.List<ContextPropagator> getContextPropagators()
- Returns:
- the list of configured context propagators
-
getPropagatedContexts
java.util.Map<java.lang.String,java.lang.Object> getPropagatedContexts()
Returns all current contexts being propagated by aContextPropagator
. The key is theContextPropagator.getName()
and the value is the object returned byContextPropagator.getCurrentContext()
-
-