Package io.temporal.payload.context
Interface SerializationContext
-
- All Known Subinterfaces:
HasWorkflowSerializationContext
- All Known Implementing Classes:
ActivitySerializationContext,WorkflowSerializationContext
public interface SerializationContextTemporal SDK may provide a subclass ofSerializationContextduring data serialization to identify the context of this serialization. This context is composed in a way to guarantee that a user object, and it's corresponded Payload will always be handled by the serialization and data conversion process with the same exact context.SerializationContextscope is defined by a Serialization Target. Serialization Target is the lowest actor in the call tree that the serializing / deserializing object orPayloadbelongs to. For example:- Workflow Input and Output parameters will always get
WorkflowSerializationContextidentifying the workflow both on theWorkflowClientand Workflow Worker sides. - Side Effect output parameters are contextualized with
WorkflowSerializationContextof the workflow this side effect belongs to. - Activity Input and Output parameters will always get
ActivitySerializationContextidentifying the activity and it's workflow on both Workflow Method and Activity Worker sides. - Child Workflow Input and Output parameters will always get
WorkflowSerializationContextidentifying the child workflow on both Parent Workflow and the Child Workflow sides.
Temporal SDK provides
SerializationContextto Data Serialization process through callingwithContextonDataConverter.withContext(SerializationContext),PayloadCodec.withContext(SerializationContext), andPayloadConverter.withContext(SerializationContext)and using the modified instance when applicable.Note: Serialization Context is experimental feature, the class and field structure of
SerializationContextobjects may change in the future. There may be also situation where the context is expected, but is not currently provided.