public interface DecisionContext extends ReplayAware
Modifier and Type | Method and Description |
---|---|
void |
continueAsNewOnCompletion(ContinueAsNewWorkflowExecutionParameters parameters) |
java.util.function.Consumer<java.lang.Exception> |
createTimer(long delaySeconds,
java.util.function.Consumer<java.lang.Exception> callback)
Create a Value that becomes ready after the specified delay.
|
long |
currentTimeMillis() |
ContinueAsNewWorkflowExecutionParameters |
getContinueAsNewOnCompletion() |
java.time.Duration |
getDecisionTaskTimeout() |
java.lang.String |
getDomain() |
boolean |
getEnableLoggingInReplay() |
java.time.Duration |
getExecutionStartToCloseTimeout() |
int |
getExecutionStartToCloseTimeoutSeconds() |
com.uber.m3.tally.Scope |
getMetricsScope() |
java.lang.String |
getRunId() |
java.lang.String |
getTaskList() |
int |
getVersion(java.lang.String changeID,
DataConverter dataConverter,
int minSupported,
int maxSupported)
GetVersion is used to safely perform backwards incompatible changes to workflow definitions.
|
WorkflowExecution |
getWorkflowExecution() |
java.lang.String |
getWorkflowId() |
WorkflowType |
getWorkflowType() |
boolean |
isCancelRequested() |
java.util.Optional<byte[]> |
mutableSideEffect(java.lang.String id,
DataConverter dataConverter,
Functions.Func1<java.util.Optional<byte[]>,java.util.Optional<byte[]>> func) |
java.util.Random |
newRandom() |
java.util.UUID |
randomUUID() |
Promise<java.lang.Void> |
requestCancelWorkflowExecution(WorkflowExecution execution) |
java.util.function.Consumer<java.lang.Exception> |
scheduleActivityTask(ExecuteActivityParameters parameters,
java.util.function.BiConsumer<byte[],java.lang.Exception> callback)
Used to dynamically schedule an activity for execution
|
void |
setContinueAsNewOnCompletion(ContinueAsNewWorkflowExecutionParameters continueParameters) |
byte[] |
sideEffect(Functions.Func<byte[]> func)
Executes the provided function once, records its result into the workflow history.
|
java.util.function.Consumer<java.lang.Exception> |
signalWorkflowExecution(SignalExternalWorkflowParameters signalParameters,
java.util.function.BiConsumer<java.lang.Void,java.lang.Exception> callback) |
java.util.function.Consumer<java.lang.Exception> |
startChildWorkflow(StartChildWorkflowExecutionParameters parameters,
java.util.function.Consumer<WorkflowExecution> executionCallback,
java.util.function.BiConsumer<byte[],java.lang.Exception> callback)
Start child workflow.
|
isReplaying
WorkflowExecution getWorkflowExecution()
WorkflowType getWorkflowType()
boolean isCancelRequested()
ContinueAsNewWorkflowExecutionParameters getContinueAsNewOnCompletion()
void setContinueAsNewOnCompletion(ContinueAsNewWorkflowExecutionParameters continueParameters)
int getExecutionStartToCloseTimeoutSeconds()
java.lang.String getTaskList()
java.lang.String getDomain()
java.lang.String getWorkflowId()
java.lang.String getRunId()
java.time.Duration getExecutionStartToCloseTimeout()
java.time.Duration getDecisionTaskTimeout()
java.util.function.Consumer<java.lang.Exception> scheduleActivityTask(ExecuteActivityParameters parameters, java.util.function.BiConsumer<byte[],java.lang.Exception> callback)
parameters
- An object which encapsulates all the information required to schedule an
activity for executioncallback
- Callback that is called upon activity completion or failure.Consumer.accept(Object)
to cancel activity task.java.util.function.Consumer<java.lang.Exception> startChildWorkflow(StartChildWorkflowExecutionParameters parameters, java.util.function.Consumer<WorkflowExecution> executionCallback, java.util.function.BiConsumer<byte[],java.lang.Exception> callback)
parameters
- An object which encapsulates all the information required to schedule a child
workflow for executioncallback
- Callback that is called upon child workflow completion or failure.Consumer.accept(Object)
to cancel activity task.java.util.function.Consumer<java.lang.Exception> signalWorkflowExecution(SignalExternalWorkflowParameters signalParameters, java.util.function.BiConsumer<java.lang.Void,java.lang.Exception> callback)
Promise<java.lang.Void> requestCancelWorkflowExecution(WorkflowExecution execution)
void continueAsNewOnCompletion(ContinueAsNewWorkflowExecutionParameters parameters)
java.util.Optional<byte[]> mutableSideEffect(java.lang.String id, DataConverter dataConverter, Functions.Func1<java.util.Optional<byte[]>,java.util.Optional<byte[]>> func)
long currentTimeMillis()
PollForDecisionTaskResponse
start event of the
decision being processed or replayed.java.util.function.Consumer<java.lang.Exception> createTimer(long delaySeconds, java.util.function.Consumer<java.lang.Exception> callback)
delaySeconds
- time-interval after which the Value becomes ready in seconds.callback
- Callback that is called with null parameter after the specified delay.
CancellationException is passed as a parameter in case of a cancellation.Consumer.accept(Object)
to cancel timer.byte[] sideEffect(Functions.Func<byte[]> func)
Error
which causes decision task failure. The decision task after timeout is rescheduled and
re-executed giving SideEffect another chance to succeed.func
- function that is called once to return a value.int getVersion(java.lang.String changeID, DataConverter dataConverter, int minSupported, int maxSupported)
changeID
- identifier of a particular changeminSupported
- min version supported for the changemaxSupported
- max version supported for the changejava.util.Random newRandom()
com.uber.m3.tally.Scope getMetricsScope()
boolean getEnableLoggingInReplay()
java.util.UUID randomUUID()