Interface HasWorkflowSerializationContext

All Superinterfaces:
SerializationContext
All Known Implementing Classes:
ActivitySerializationContext, WorkflowSerializationContext

public interface HasWorkflowSerializationContext extends SerializationContext
SerializationContext that contains Namespace and Workflow ID of the Serialization Target.

This interface is a convenience interface for users that customize DataConverters. This interface provides a unified API for SerializationContext implementations that contain information about the Workflow Execution the Serialization Target belongs to. If some Workflow is Serialization target itself, methods of this interface will return information of that workflow.

  • Method Details

    • getNamespace

      String getNamespace()
      Returns:
      namespace the workflow execution belongs to
    • getWorkflowId

      @Nullable String getWorkflowId()
      Returns:
      workflowId of the Workflow Execution the Serialization Target belongs to. If the Target is a Workflow itself, this method will return the Target's Workflow ID (not the ID of the parent workflow). Returns null for standalone activities (not associated with a workflow).

      WARNING: When used in the context of a schedule workflow the workflowId may differ on serialization and deserialization.