Package io.temporal.activity
Interface ActivityInfo
-
public interface ActivityInfoInformation 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.StringgetActivityId()ID of the Activity Execution.java.lang.StringgetActivityNamespace()Deprecated.usegetNamespace()java.lang.StringgetActivityTaskQueue()java.lang.StringgetActivityType()intgetAttempt()Gets the current Activity Execution attempt count.longgetCurrentAttemptScheduledTimestamp()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.DurationgetHeartbeatTimeout()java.lang.StringgetNamespace()java.lang.StringgetRunId()longgetScheduledTimestamp()Time when the Activity Execution was initially scheduled by the Workflow Execution.java.time.DurationgetScheduleToCloseTimeout()longgetStartedTimestamp()Time when the Activity Task (current attempt) was started.java.time.DurationgetStartToCloseTimeout()byte[]getTaskToken()java.lang.StringgetWorkflowId()java.lang.StringgetWorkflowNamespace()Deprecated.usegetNamespace()java.lang.StringgetWorkflowType()booleanisLocal()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.ZEROif 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.
-
-