Package com.uber.cadence.internal.sync
Interface ActivityExecutionContext
-
public interface ActivityExecutionContext
Context object passed to an activity implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
doNotCompleteOnReturn()
If this method is called during an activity execution then activity is not going to complete when its method returns.java.lang.String
getDomain()
<V> java.util.Optional<V>
getHeartbeatDetails(java.lang.Class<V> detailsClass, java.lang.reflect.Type detailsType)
IWorkflowService
getService()
ActivityTask
getTask()
byte[]
getTaskToken()
WorkflowExecution
getWorkflowExecution()
boolean
isDoNotCompleteOnReturn()
<V> void
recordActivityHeartbeat(V details)
Use to notify Simple Workflow that activity execution is alive.
-
-
-
Method Detail
-
getTaskToken
byte[] getTaskToken()
- Returns:
- task token that is required to report task completion when manual activity completion is used.
-
getWorkflowExecution
WorkflowExecution getWorkflowExecution()
- Returns:
- workfow execution that requested the activity execution
-
getTask
ActivityTask getTask()
- Returns:
- task that caused activity execution
-
recordActivityHeartbeat
<V> void recordActivityHeartbeat(V details) throws ActivityCompletionException
Use to notify Simple Workflow that activity execution is alive.- Parameters:
details
- In case of activity timeout details are returned as a field of the exception thrown.- Throws:
java.util.concurrent.CancellationException
- Indicates that activity cancellation was requested by the workflow.Should be rethrown from activity implementation to indicate successful cancellation.ActivityCompletionException
-
getHeartbeatDetails
<V> java.util.Optional<V> getHeartbeatDetails(java.lang.Class<V> detailsClass, java.lang.reflect.Type detailsType)
-
doNotCompleteOnReturn
void doNotCompleteOnReturn()
If this method is called during an activity execution then activity is not going to complete when its method returns. It is expected to be completed asynchronously usingActivityCompletionClient
.
-
isDoNotCompleteOnReturn
boolean isDoNotCompleteOnReturn()
-
getService
IWorkflowService getService()
- Returns:
- an instance of the Simple Workflow Java client that is the same used by the invoked activity worker.
-
getDomain
java.lang.String getDomain()
-
-