Package io.temporal.payload.context
Interface SerializationContext
-
- All Known Subinterfaces:
HasWorkflowSerializationContext
- All Known Implementing Classes:
ActivitySerializationContext
,WorkflowSerializationContext
public interface SerializationContext
Temporal SDK may provide a subclass ofSerializationContext
during 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.SerializationContext
scope is defined by a Serialization Target. Serialization Target is the lowest actor in the call tree that the serializing / deserializing object orPayload
belongs to. For example:- Workflow Input and Output parameters will always get
WorkflowSerializationContext
identifying the workflow both on theWorkflowClient
and Workflow Worker sides. - Side Effect output parameters are contextualized with
WorkflowSerializationContext
of the workflow this side effect belongs to. - Activity Input and Output parameters will always get
ActivitySerializationContext
identifying the activity and it's workflow on both Workflow Method and Activity Worker sides. - Child Workflow Input and Output parameters will always get
WorkflowSerializationContext
identifying the child workflow on both Parent Workflow and the Child Workflow sides.
Temporal SDK provides
SerializationContext
to Data Serialization process through callingwithContext
onDataConverter.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
SerializationContext
objects may change in the future. There may be also situation where the context is expected, but is not currently provided.