Class ActivityExecutionDescription

java.lang.Object
io.temporal.client.ActivityExecutionMetadata
io.temporal.client.ActivityExecutionDescription

public final class ActivityExecutionDescription extends ActivityExecutionMetadata
Detailed information about a standalone activity execution, returned by UntypedActivityHandle.describe().
  • Constructor Details

    • ActivityExecutionDescription

      public ActivityExecutionDescription(io.temporal.api.workflowservice.v1.DescribeActivityExecutionResponse response, DataConverter dataConverter, String namespace)
  • Method Details

    • getRawResponse

      @Nonnull public io.temporal.api.workflowservice.v1.DescribeActivityExecutionResponse getRawResponse()
      Underlying proto response. Exposed while the standalone activity surface is experimental.
    • getRawInfo

      @Nonnull public io.temporal.api.activity.v1.ActivityExecutionInfo getRawInfo()
      The raw protobuf info returned by the server for this activity execution.
    • getAttempt

      public int getAttempt()
      Current attempt number (starts at 1).
    • getTotalHeartbeatCount

      public long getTotalHeartbeatCount()
      Returns:
      total number of heartbeats recorded across all attempts.
    • getCanceledReason

      @Nullable public String getCanceledReason()
      Reason that was provided when cancellation was requested. null if not cancelled or no reason was given.
    • getCurrentRetryInterval

      @Nullable public Duration getCurrentRetryInterval()
      Current or next retry interval. null if no retries are configured or allowed.
    • getExpirationTime

      @Nullable public Instant getExpirationTime()
      When the activity will time out (scheduled time + scheduleToCloseTimeout).
    • getHeartbeatTimeout

      @Nullable public Duration getHeartbeatTimeout()
      Maximum allowed time between heartbeats.
    • getLastAttemptCompleteTime

      @Nullable public Instant getLastAttemptCompleteTime()
      Time the last attempt completed (succeeded or failed).
    • getLastHeartbeatTime

      @Nullable public Instant getLastHeartbeatTime()
      Time the last heartbeat was recorded.
    • getLastStartedTime

      @Nullable public Instant getLastStartedTime()
      Time the last attempt was started.
    • getExecutionTime

      @Nullable public Instant getExecutionTime()
      Time the first activity task was made available for dispatch. Computed as schedule_time + start_delay; equals schedule_time when no start delay is set.
    • getStartDelay

      @Nullable public Duration getStartDelay()
      Delay before the first activity task is made available for dispatch. Not applied to retry attempts. null if no start delay is set.
    • hasLastFailure

      public boolean hasLastFailure()
      Whether a failure from a failed attempt is present. false when the activity has no failed attempt, and also when the description was requested without DescribeActivityOptions.Builder.setIncludeLastFailure(boolean).
    • getLastFailure

      @Nullable public RuntimeException getLastFailure()
      Failure details from the last failed attempt. null if no failure has occurred.
    • getLastWorkerIdentity

      @Nullable public String getLastWorkerIdentity()
      Identity of the worker that last processed this activity.
    • getNextAttemptScheduleTime

      @Nullable public Instant getNextAttemptScheduleTime()
      Time when the next retry attempt will be scheduled.
    • getRetryOptions

      @Nullable public RetryOptions getRetryOptions()
      Retry policy for this activity.
    • getRunState

      @Nonnull public io.temporal.api.enums.v1.PendingActivityState getRunState()
      Detailed run state (e.g. scheduled, started, backing off). Only meaningful when ActivityExecutionMetadata.getStatus() is ActivityExecutionStatus.ACTIVITY_EXECUTION_STATUS_RUNNING.
    • getScheduleToCloseTimeout

      @Nullable public Duration getScheduleToCloseTimeout()
      Total time the caller is willing to wait for the activity to complete, including retries.
    • getScheduleToStartTimeout

      @Nullable public Duration getScheduleToStartTimeout()
      Maximum time the task may wait in the task queue.
    • getStartToCloseTimeout

      @Nullable public Duration getStartToCloseTimeout()
      Maximum time for a single attempt.
    • hasHeartbeatDetails

      public boolean hasHeartbeatDetails()
      Whether heartbeat details were recorded for the last attempt. false when the activity recorded none, and also when the description was requested without DescribeActivityOptions.Builder.setIncludeHeartbeatDetails(boolean).
    • getHeartbeatDetails

      public EncodedValues getHeartbeatDetails()
      The details recorded by the last heartbeat, as lazily-decoded values. Empty (size 0) when no heartbeat details are present, either because none were recorded or because the description was requested without DescribeActivityOptions.Builder.setIncludeHeartbeatDetails(boolean).
    • hasInput

      public boolean hasInput()
      Whether the activity's input is present. false unless the description was requested with DescribeActivityOptions.Builder.setIncludeInput(boolean).
    • getInput

      public EncodedValues getInput()
      The activity's input arguments, as lazily-decoded values, one per argument. Empty (size 0) when no input is present, either because the activity took no arguments or because the description was requested without DescribeActivityOptions.Builder.setIncludeInput(boolean).
    • hasResult

      public boolean hasResult()
      Whether the activity closed with a successful result. false while the activity is still running, when it closed with a failure, or when the description was requested without DescribeActivityOptions.Builder.setIncludeOutcome(boolean).
    • getResult

      public <V> Optional<V> getResult(Class<V> valueType)
      Deserializes the activity's success result. Returns Optional.empty() if no result is present (activity still running, closed with a failure, or includeOutcome was false).
      Parameters:
      valueType - the class to deserialize the result into
    • getResult

      public <V> Optional<V> getResult(Class<V> valueType, @Nullable Type genericType)
      Deserializes the activity's success result into the given generic type. Returns Optional.empty() if no result is present.
      Parameters:
      valueType - the class to deserialize the result into
      genericType - the generic type for deserialization; may equal valueType
    • getOutcomeFailure

      @Nullable public RuntimeException getOutcomeFailure()
      The failure the activity closed with, as an exception. null if the activity did not close with a failure or if includeOutcome was false on the describe call.

      This is the terminal outcome; getLastFailure() is the failure of the most recent attempt, which may be set while the activity is still retrying.

    • getWorkerDeploymentVersion

      @Nullable public WorkerDeploymentVersion getWorkerDeploymentVersion()
      The deployment version of the worker that last processed this activity. null if not available.
    • getPriority

      @Nullable public Priority getPriority()
      Priority hint for this activity. null if not set.
    • getSummary

      @Nullable public String getSummary()
      Fixed summary set when the activity was started. Decoded from UserMetadata on each call; cache the result if called multiple times.
    • getStaticDetails

      @Nullable public String getStaticDetails()
      Fixed details set when the activity was started. Decoded from UserMetadata on each call; cache the result if called multiple times.