Class ActivitySerializationContext

java.lang.Object
io.temporal.payload.context.ActivitySerializationContext
All Implemented Interfaces:
HasWorkflowSerializationContext, SerializationContext

@Experimental public class ActivitySerializationContext extends Object implements HasWorkflowSerializationContext
  • Constructor Details

    • ActivitySerializationContext

      public ActivitySerializationContext(@Nonnull String namespace, @Nullable String workflowId, @Nullable String workflowType, @Nonnull String activityType, @Nonnull String activityTaskQueue, boolean local)
      Parameters:
      namespace - the activity's namespace; must not be null
      workflowId - the workflow ID that scheduled the activity, or null for standalone activities (stored as an empty string)
      workflowType - the workflow type that scheduled the activity, or null for standalone activities (stored as an empty string)
      activityType - the activity type name; must not be null
      activityTaskQueue - the task queue for this activity; must not be null
      local - true if this is a local activity
    • ActivitySerializationContext

      public ActivitySerializationContext(ActivityInfo info)
  • Method Details

    • getNamespace

      @Nonnull public String getNamespace()
      Specified by:
      getNamespace in interface HasWorkflowSerializationContext
      Returns:
      namespace the workflow execution belongs to
    • getWorkflowId

      @Nullable public String getWorkflowId()
      Specified by:
      getWorkflowId in interface HasWorkflowSerializationContext
      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.

    • getWorkflowType

      @Nullable public String getWorkflowType()
    • getActivityType

      @Nonnull public String getActivityType()
    • getActivityTaskQueue

      @Nonnull public String getActivityTaskQueue()
    • isLocal

      public boolean isLocal()