Package io.dapr.workflows
Class WorkflowTaskRetryContext
java.lang.Object
io.dapr.workflows.WorkflowTaskRetryContext
-
Constructor Summary
ConstructorsConstructorDescriptionWorkflowTaskRetryContext(DefaultWorkflowContext workflowContext, int lastAttemptNumber, WorkflowFailureDetails lastFailure, Duration totalRetryTime) Constructor for WorkflowTaskRetryContext. -
Method Summary
Modifier and TypeMethodDescriptionintGets the previous retry attempt number.Gets the details of the previous task failure, including the exception type, message, and callstack.Gets the total amount of time spent in a retry loop for the current task.Gets the context of the current workflow.
-
Constructor Details
-
WorkflowTaskRetryContext
public WorkflowTaskRetryContext(DefaultWorkflowContext workflowContext, int lastAttemptNumber, WorkflowFailureDetails lastFailure, Duration totalRetryTime) Constructor for WorkflowTaskRetryContext.- Parameters:
workflowContext- The workflow contextlastAttemptNumber- The number of the previous attemptlastFailure- The failure details from the most recent failuretotalRetryTime- The amount of time spent retrying
-
-
Method Details
-
getWorkflowContext
Gets the context of the current workflow.The workflow context can be used in retry handlers to schedule timers (via the
DefaultWorkflowContext.createTimer(java.time.Duration)methods) for implementing delays between retries. It can also be used to implement time-based retry logic by using theDefaultWorkflowContext.getCurrentInstant()method.- Returns:
- the context of the parent workflow
-
getLastFailure
Gets the details of the previous task failure, including the exception type, message, and callstack.- Returns:
- the details of the previous task failure
-
getLastAttemptNumber
public int getLastAttemptNumber()Gets the previous retry attempt number. This number starts at 1 and increments each time the retry handler is invoked for a particular task failure.- Returns:
- the previous retry attempt number
-
getTotalRetryTime
Gets the total amount of time spent in a retry loop for the current task.- Returns:
- the total amount of time spent in a retry loop for the current task
-