Class WorkflowInternal
java.lang.Object
io.temporal.internal.sync.WorkflowInternal
Never reference directly. It is public only because Java doesn't have internal package support.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyActivityOptions(Map<String, ActivityOptions> activityTypeToOptions) static voidapplyLocalActivityOptions(Map<String, LocalActivityOptions> activityTypeToOptions) static voidstatic booleancancelWorkflow(io.temporal.api.common.v1.WorkflowExecution execution) cancelWorkflow(io.temporal.api.common.v1.WorkflowExecution execution, String reason) static voidcontinueAsNew(String workflowType, ContinueAsNewOptions options, Object[] args) static voidcontinueAsNew(String workflowType, ContinueAsNewOptions options, Object[] args, WorkflowOutboundCallsInterceptor outboundCallsInterceptor) static io.temporal.internal.sync.CancellationScopeImplstatic longShould be used to get current time instead ofSystem.currentTimeMillis()static <T> TdeadlockDetectorOff(Functions.Func<T> func) static <R> RexecuteActivity(String name, ActivityOptions options, Class<R> resultClass, Type resultType, Object... args) Execute activity by name.static Stringstatic Optional<UpdateInfo> static DataConverterstatic Objectstatic <R> RgetLastCompletionResult(Class<R> resultClass, Type resultType) static org.slf4j.Loggerstatic org.slf4j.Loggerstatic <T> Tstatic com.uber.m3.tally.Scopestatic <T> TgetSearchAttribute(String name) static <T> List<T> static SearchAttributesstatic intgetVersion(String changeId, int minSupported, int maxSupported) static Promise<io.temporal.api.common.v1.WorkflowExecution> getWorkflowExecution(Object workflowStub) static WorkflowInfostatic StringgetWorkflowType(Class<?> workflowInterfaceClass) Name of the workflow type the interface defines.static booleanstatic booleanReturns false if not under workflow code.static booleanstatic <R> RmutableSideEffect(String id, Class<R> resultClass, Type resultType, BiPredicate<R, R> updated, Functions.Func<R> func) static <R> RmutableSideEffect(String id, Class<R> resultClass, Type resultType, BiPredicate<R, R> updated, Functions.Func<R> func, MutableSideEffectOptions options) static <T> TnewActivityStub(Class<T> activityInterface, ActivityOptions options, Map<String, ActivityOptions> activityMethodOptions) Creates client stub to activities that implement given interface.static CancellationScopenewCancellationScope(boolean detached, Functions.Proc1<CancellationScope> proc) static CancellationScopenewCancellationScope(boolean detached, Runnable runnable) static <T> TnewChildWorkflowStub(Class<T> workflowInterface, ChildWorkflowOptions options) static <E> CompletablePromise<E> static <T> TnewContinueAsNewStub(Class<T> workflowInterface, ContinueAsNewOptions options) Creates client stub that can be used to continue this workflow as new.static <T> TnewExternalWorkflowStub(Class<T> workflowInterface, io.temporal.api.common.v1.WorkflowExecution execution) static <E> Promise<E> newFailedPromise(Exception failure) static <T> TnewLocalActivityStub(Class<T> activityInterface, LocalActivityOptions options, Map<String, LocalActivityOptions> activityMethodOptions) Creates client stub to local activities that implement given interface.static <T> TnewNexusServiceStub(Class<T> serviceInterface, NexusServiceOptions options) static <E> Promise<E> newPromise(E value) static <E> WorkflowQueue<E> newQueue(int capacity) Deprecated.this method created a deprecated implementation of the queue that has some methods implemented incorrectly.static RandomnewTimer(Duration duration, TimerOptions options) static ActivityStubnewUntypedActivityStub(ActivityOptions options) static ChildWorkflowStubnewUntypedChildWorkflowStub(String workflowType, ChildWorkflowOptions options) static ExternalWorkflowStubnewUntypedExternalWorkflowStub(io.temporal.api.common.v1.WorkflowExecution execution) static ActivityStubstatic NexusServiceStubnewUntypedNexusServiceStub(String service, NexusServiceOptions options) static WorkflowLockstatic WorkflowThreadnewWorkflowMethodThread(Runnable runnable, String name) static <E> WorkflowQueue<E> newWorkflowQueue(int capacity) Creates aWorkflowQueueimplementation that can be used from workflow code.static WorkflowSemaphorenewWorkflowSemaphore(int permits) promiseAllOf(Promise<?>... promises) promiseAllOf(Iterable<Promise<V>> promises) promiseAnyOf(Promise<?>... promises) static <V> Promise<V> promiseAnyOf(Iterable<Promise<V>> promises) static UUIDstatic voidregisterListener(Object implementation) Register query or queries implementation object.static <R> Rretry(RetryOptions options, Optional<Duration> expiration, Functions.Func<R> fn) static voidsetCurrentDetails(String details) static voidsetDefaultActivityOptions(ActivityOptions activityOptions) static voidsetDefaultLocalActivityOptions(LocalActivityOptions localActivityOptions) static <R> RsideEffect(Class<R> resultClass, Type resultType, Functions.Func<R> func) static <R> RsideEffect(Class<R> resultClass, Type resultType, Functions.Func<R> func, SideEffectOptions options) static voidstatic <R> NexusOperationHandle<R> startNexusOperation(Functions.Func<R> operation) static <T,R> NexusOperationHandle <R> startNexusOperation(Functions.Func1<T, R> operation, T arg) static Throwablestatic voidupsertMemo(Map<String, Object> memo) static voidupsertSearchAttributes(Map<String, ?> searchAttributes) static voidupsertTypedSearchAttributes(SearchAttributeUpdate<?>... searchAttributeUpdates) static RuntimeException
-
Field Details
-
DEFAULT_VERSION
public static final int DEFAULT_VERSION- See Also:
-
-
Method Details
-
newWorkflowMethodThread
-
newTimer
-
newTimer
-
newQueue
Deprecated.this method created a deprecated implementation of the queue that has some methods implemented incorrectly. Please usenewWorkflowQueue(int)instead.- Parameters:
capacity- the maximum size of the queue- Returns:
- new instance of
WorkflowQueue
-
newWorkflowQueue
Creates aWorkflowQueueimplementation that can be used from workflow code.- Parameters:
capacity- the maximum size of the queue- Returns:
- new instance of
WorkflowQueue
-
newWorkflowLock
-
newWorkflowSemaphore
-
newCompletablePromise
-
newPromise
-
newFailedPromise
-
registerListener
Register query or queries implementation object. There is no need to register top level workflow implementation object as it is done implicitly. Only methods annotated with @QueryMethodare registered. TODO(quinn) LIES! -
currentTimeMillis
public static long currentTimeMillis()Should be used to get current time instead ofSystem.currentTimeMillis() -
setDefaultActivityOptions
-
applyActivityOptions
-
setDefaultLocalActivityOptions
-
applyLocalActivityOptions
public static void applyLocalActivityOptions(Map<String, LocalActivityOptions> activityTypeToOptions) -
newActivityStub
public static <T> T newActivityStub(Class<T> activityInterface, ActivityOptions options, Map<String, ActivityOptions> activityMethodOptions) Creates client stub to activities that implement given interface.- Parameters:
activityInterface- interface type implemented by activitiesoptions- options that together with the properties ofActivityMethodspecify the activity invocation parametersactivityMethodOptions- activity method-specific invocation parameters
-
newLocalActivityStub
public static <T> T newLocalActivityStub(Class<T> activityInterface, LocalActivityOptions options, @Nullable Map<String, LocalActivityOptions> activityMethodOptions) Creates client stub to local activities that implement given interface.- Parameters:
activityInterface- interface type implemented by activitiesoptions- options that together with the properties ofActivityMethodspecify the activity invocation parametersactivityMethodOptions- activity method-specific invocation parameters
-
newUntypedActivityStub
-
newUntypedLocalActivityStub
-
newChildWorkflowStub
-
newExternalWorkflowStub
public static <T> T newExternalWorkflowStub(Class<T> workflowInterface, io.temporal.api.common.v1.WorkflowExecution execution) -
getWorkflowExecution
-
newUntypedChildWorkflowStub
public static ChildWorkflowStub newUntypedChildWorkflowStub(String workflowType, ChildWorkflowOptions options) -
newUntypedExternalWorkflowStub
public static ExternalWorkflowStub newUntypedExternalWorkflowStub(io.temporal.api.common.v1.WorkflowExecution execution) -
newContinueAsNewStub
Creates client stub that can be used to continue this workflow as new.- Parameters:
workflowInterface- interface type implemented by the next generation of workflow
-
executeActivity
public static <R> R executeActivity(String name, ActivityOptions options, Class<R> resultClass, Type resultType, Object... args) Execute activity by name.- Type Parameters:
R- activity return type- Parameters:
name- name of the activityresultClass- activity return typeargs- list of activity arguments- Returns:
- activity result
-
await
public static void await(String reason, Supplier<Boolean> unblockCondition) throws DestroyWorkflowThreadError - Throws:
DestroyWorkflowThreadError
-
await
public static boolean await(Duration timeout, String reason, Supplier<Boolean> unblockCondition) throws DestroyWorkflowThreadError - Throws:
DestroyWorkflowThreadError
-
sideEffect
-
sideEffect
public static <R> R sideEffect(Class<R> resultClass, Type resultType, Functions.Func<R> func, SideEffectOptions options) -
mutableSideEffect
public static <R> R mutableSideEffect(String id, Class<R> resultClass, Type resultType, BiPredicate<R, R> updated, Functions.Func<R> func) -
mutableSideEffect
public static <R> R mutableSideEffect(String id, Class<R> resultClass, Type resultType, BiPredicate<R, R> updated, Functions.Func<R> func, MutableSideEffectOptions options) -
getVersion
-
promiseAllOf
-
promiseAllOf
-
promiseAnyOf
-
promiseAnyOf
-
newCancellationScope
-
newCancellationScope
public static CancellationScope newCancellationScope(boolean detached, Functions.Proc1<CancellationScope> proc) -
currentCancellationScope
public static io.temporal.internal.sync.CancellationScopeImpl currentCancellationScope() -
wrap
-
unwrap
-
isReplaying
public static boolean isReplaying()Returns false if not under workflow code. -
getMemo
-
retry
public static <R> R retry(RetryOptions options, Optional<Duration> expiration, Functions.Func<R> fn) -
continueAsNew
public static void continueAsNew(@Nullable String workflowType, @Nullable ContinueAsNewOptions options, Object[] args) -
continueAsNew
public static void continueAsNew(@Nullable String workflowType, @Nullable ContinueAsNewOptions options, Object[] args, WorkflowOutboundCallsInterceptor outboundCallsInterceptor) -
cancelWorkflow
-
cancelWorkflow
-
sleep
-
isWorkflowThread
public static boolean isWorkflowThread() -
deadlockDetectorOff
-
getWorkflowInfo
-
getCurrentUpdateInfo
-
getMetricsScope
public static com.uber.m3.tally.Scope getMetricsScope() -
randomUUID
-
newRandom
-
getLogger
-
getLogger
-
getLastCompletionResult
-
getSearchAttribute
-
getSearchAttributeValues
-
getSearchAttributes
-
getTypedSearchAttributes
-
upsertSearchAttributes
-
upsertTypedSearchAttributes
-
upsertMemo
-
getDataConverter
-
getWorkflowType
Name of the workflow type the interface defines. It is either the interface short name * or value ofWorkflowMethod.name()parameter.- Parameters:
workflowInterfaceClass- interface annotated with @WorkflowInterface
-
getPreviousRunFailure
-
isEveryHandlerFinished
public static boolean isEveryHandlerFinished() -
newNexusServiceStub
-
newUntypedNexusServiceStub
public static NexusServiceStub newUntypedNexusServiceStub(String service, NexusServiceOptions options) -
startNexusOperation
public static <T,R> NexusOperationHandle<R> startNexusOperation(Functions.Func1<T, R> operation, T arg) -
startNexusOperation
-
setCurrentDetails
-
getCurrentDetails
-
getInstance
-