Package io.temporal.activity
Interface ActivityInfo
-
public interface ActivityInfo
Information about the Activity Task that the current Activity Execution is handling. UseActivityExecutionContext.getInfo()
to access.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getActivityId()
ID of the Activity Execution.java.lang.String
getActivityNamespace()
Deprecated.usegetNamespace()
java.lang.String
getActivityTaskQueue()
java.lang.String
getActivityType()
int
getAttempt()
Gets the current Activity Execution attempt count.long
getCurrentAttemptScheduledTimestamp()
Time when the Activity Task (current attempt) was scheduled by the Temporal Server.java.util.Optional<io.temporal.api.common.v1.Payloads>
getHeartbeatDetails()
java.time.Duration
getHeartbeatTimeout()
java.lang.String
getNamespace()
java.lang.String
getRunId()
long
getScheduledTimestamp()
Time when the Activity Execution was initially scheduled by the Workflow Execution.java.time.Duration
getScheduleToCloseTimeout()
long
getStartedTimestamp()
Time when the Activity Task (current attempt) was started.java.time.Duration
getStartToCloseTimeout()
byte[]
getTaskToken()
java.lang.String
getWorkflowId()
java.lang.String
getWorkflowNamespace()
Deprecated.usegetNamespace()
java.lang.String
getWorkflowType()
boolean
isLocal()
Used to determine if the Activity Execution is a local Activity.
-
-
-
Method Detail
-
getTaskToken
byte[] getTaskToken()
- Returns:
- a correlation token that can be used to complete the Activity Execution asynchronously
through
ActivityCompletionClient.complete(byte[], Object)
.
-
getWorkflowId
java.lang.String getWorkflowId()
- Returns:
- WorkflowId of the Workflow Execution that scheduled the Activity Execution.
-
getRunId
java.lang.String getRunId()
- Returns:
- RunId of the Workflow Execution that scheduled the Activity Execution.
-
getActivityId
java.lang.String getActivityId()
ID of the Activity Execution. This ID can be used to complete the Activity Execution asynchronously throughActivityCompletionClient.complete(String, Optional, String, Object)
.
-
getActivityType
java.lang.String getActivityType()
- Returns:
- type of the Activity.
-
getScheduledTimestamp
long getScheduledTimestamp()
Time when the Activity Execution was initially scheduled by the Workflow Execution.- Returns:
- Timestamp in milliseconds (UNIX Epoch time)
-
getStartedTimestamp
long getStartedTimestamp()
Time when the Activity Task (current attempt) was started.- Returns:
- Timestamp in milliseconds (UNIX Epoch time)
-
getCurrentAttemptScheduledTimestamp
long getCurrentAttemptScheduledTimestamp()
Time when the Activity Task (current attempt) was scheduled by the Temporal Server.- Returns:
- Timestamp in milliseconds (UNIX Epoch time)
-
getScheduleToCloseTimeout
java.time.Duration getScheduleToCloseTimeout()
- Returns:
- the Schedule-To-Close Timeout setting as a Duration.
-
getStartToCloseTimeout
java.time.Duration getStartToCloseTimeout()
- Returns:
- the Start-To-Close Timeout setting as a Duration.
-
getHeartbeatTimeout
@Nonnull java.time.Duration getHeartbeatTimeout()
- Returns:
- the Heartbeat Timeout setting as a Duration.
Duration.ZERO
if absent
-
getHeartbeatDetails
java.util.Optional<io.temporal.api.common.v1.Payloads> getHeartbeatDetails()
-
getWorkflowType
java.lang.String getWorkflowType()
- Returns:
- the Workflow Type of the Workflow Execution that executed the Activity.
-
getWorkflowNamespace
@Deprecated java.lang.String getWorkflowNamespace()
Deprecated.usegetNamespace()
Note: At some moment Temporal had built-in support for scheduling activities on a different namespace than the original workflow. Currently, Workflows can schedule activities only on the same namespace, hence no need for differentgetWorkflowNamespace()
andgetActivityNamespace()
methods.- Returns:
- the Namespace of Workflow Execution that scheduled the Activity.
-
getActivityNamespace
@Deprecated java.lang.String getActivityNamespace()
Deprecated.usegetNamespace()
Note: At some moment Temporal had built-in support for scheduling activities on a different namespace than the original workflow. Currently, Workflows can schedule activities only on the same namespace, hence no need for differentgetWorkflowNamespace()
andgetActivityNamespace()
methods.- Returns:
- the Namespace of this Activity Execution.
-
getNamespace
java.lang.String getNamespace()
-
getActivityTaskQueue
java.lang.String getActivityTaskQueue()
-
getAttempt
int getAttempt()
Gets the current Activity Execution attempt count. Attempt counts start at 1 and increment on each Activity Task Execution retry.
-
isLocal
boolean isLocal()
Used to determine if the Activity Execution is a local Activity.
-
-