object ZWorkflow extends ZWorkflowVersionSpecific

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZWorkflow
  2. ZWorkflowVersionSpecific
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val DefaultVersion: Int
  5. def applyActivityOptions(values: Map[String, ZActivityOptions]): Unit

    Adds activity options per activity type (activity method name) that will be used for an activity stub that has no ZActivityOptions specified.
    This method refines an original set of @code Map<String, ActivityOptions> provided by zio.temporal.worker.ZWorkflowImplementationOptions.activityOptions
    These more specific options take precedence over more generic setting setDefaultActivityOptions

    Adds activity options per activity type (activity method name) that will be used for an activity stub that has no ZActivityOptions specified.
    This method refines an original set of @code Map<String, ActivityOptions> provided by zio.temporal.worker.ZWorkflowImplementationOptions.activityOptions
    These more specific options take precedence over more generic setting setDefaultActivityOptions

    If an activity type already has a ZActivityOptions set by an earlier call to this method or from zio.temporal.worker.ZWorkflowImplementationOptions.defaultActivityOptions, new ZActivityOptions from values will be merged into the old ones by Java SDK's ActivityOptions.Builder.mergeActivityOptions

    values

    a map of activity types to ZActivityOptions

  6. def applyActivityOptions(values: (String, ZActivityOptions)*): Unit

  7. def applyLocalActivityOptions(values: Map[String, ZLocalActivityOptions]): Unit

    Adds local activity options per activity type (activity method name) that will be used for a local activity stub that has no ZLocalActivityOptions specified.
    This method refines an original set of options provided by zio.temporal.worker.ZWorkflowImplementationOptions.defaultLocalActivityOptions
    These more specific options take precedence over more generic setting setDefaultLocalActivityOptions

    Adds local activity options per activity type (activity method name) that will be used for a local activity stub that has no ZLocalActivityOptions specified.
    This method refines an original set of options provided by zio.temporal.worker.ZWorkflowImplementationOptions.defaultLocalActivityOptions
    These more specific options take precedence over more generic setting setDefaultLocalActivityOptions

    If an activity type already has a ZLocalActivityOptions set by an earlier call to this method or from zio.temporal.worker.ZWorkflowImplementationOptions.defaultLocalActivityOptions, new ZLocalActivityOptions from values will be merged into the old ones using LocalActivityOptions.Builder.mergeActivityOptions

    values

    a map of activity types to ZLocalActivityOptions

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def awaitUntil(timeout: zio.Duration)(cond: => Boolean): Boolean

    Suspends workflow execution until either the given predicate holds or timeout elapsed

    Suspends workflow execution until either the given predicate holds or timeout elapsed

    timeout

    await timeout

    cond

    await condition

    returns

    unblocks when condition becomes true or timeout elapsed. False if timed out

    See also

    Workflow.await

  10. def awaitUntil(cond: => Boolean): Unit

    Suspends workflow execution until the given predicate holds

    Suspends workflow execution until the given predicate holds

    cond

    await condition

    returns

    unblocks when condition becomes true

    See also

    Workflow.await

  11. def awaitWhile(timeout: zio.Duration)(cond: => Boolean): Boolean

    Suspends workflow execution while either the given predicate holds or timeout elapsed

    Suspends workflow execution while either the given predicate holds or timeout elapsed

    timeout

    await timeout

    cond

    await condition

    returns

    unblocks when condition becomes false or timeout elapsed. False if timed out

    See also

    Workflow.await

  12. def awaitWhile(cond: => Boolean): Unit

    Suspends workflow execution while the given predicate holds

    Suspends workflow execution while the given predicate holds

    cond

    await condition

    returns

    unblocks when condition becomes false

    See also

    Workflow.await

  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  14. def continueAsNew(workflowType: String, options: Option[ZContinueAsNewOptions], args: Any*): Unit

    Continues the current workflow execution as a new run possibly overriding the workflow type and options.

    Continues the current workflow execution as a new run possibly overriding the workflow type and options.

    workflowType

    workflow type override for the next run, can be null of no override is needed

    options

    option overrides for the next run, can be null if no overrides are needed

    args

    arguments of the next run.

  15. def currentTimeMillis: ZCurrentTimeMillis

    Returns current timestamp

    Returns current timestamp

    Should be used instead of java.lang.System.currentTimeMillis() to guarantee determinism

    returns

    current time millis as ZCurrentTimeMillis

    See also

    Workflow.currentTimeMillis()

  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  19. def getLastCompletionResult[R](implicit arg0: TypeIsSpecified[R], arg1: JavaTypeTag[R]): R

    GetLastCompletionResult extract last completion result from previous run for this cron workflow.

    GetLastCompletionResult extract last completion result from previous run for this cron workflow. This is used in combination with cron schedule. A workflow can be started with an optional cron schedule. If a cron workflow wants to pass some data to next schedule, it can return any data and that data will become available when next run starts.

    R

    type of the return data from last run

    returns

    result of last run

    See also

    io.temporal.client.WorkflowOptions.Builder#setCronSchedule(String)

  20. def getLogger(clazz: Class[_]): Logger

    Get logger to use inside workflow.

    Get logger to use inside workflow. Logs in replay mode are omitted unless zio.temporal.worker.ZWorkerFactoryOptions.enableLoggingInReplay is set to 'true'.

    clazz

    class name to appear in logging.

    returns

    logger to use in workflow logic.

  21. def getLogger(name: String): Logger

    Get logger to use inside workflow.

    Get logger to use inside workflow. Logs in replay mode are omitted unless zio.temporal.worker.ZWorkerFactoryOptions.enableLoggingInReplay is set to 'true'.

    name

    name to appear in logging.

    returns

    logger to use in workflow logic.

  22. def getMemo[T](key: String)(implicit javaTypeTag: JavaTypeTag[T]): Option[T]

    Extract Memo associated with the given key and deserialized into an object of generic type.

    Extract Memo associated with the given key and deserialized into an object of generic type.

    T

    Scala type

    key

    memo key

    returns

    Some of deserialized Memo or None if the key is not present in the memo

  23. def getPreviousRunFailure: Option[Exception]

    Extract the latest failure from a previous run of this workflow.

    Extract the latest failure from a previous run of this workflow. If any previous run of this workflow has failed, this function returns that failure. If no previous runs have failed, an empty optional is returned. The run you are calling this from may have been created as a retry of the previous failed run or as a next cron invocation for cron workflows.

    returns

    The last Exceptionthat occurred in this workflow, if there has been one.

  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  25. def info: ZWorkflowInfo

    Retrieves workflow info

    Retrieves workflow info

    returns

    ZWorkflowInfo

    See also

    io.temporal.workflow.WorkflowInfo

  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. macro def makeLogger: Logger

    Get logger to use inside workflow.

    Get logger to use inside workflow. Logs in replay mode are omitted unless zio.temporal.worker.ZWorkerFactoryOptions.enableLoggingInReplay is set to 'true'.

    The logger name will correspond to the enclosing class/trait name.

    returns

    logger to use in workflow logic.

    Definition Classes
    ZWorkflowVersionSpecific
  28. def metricsScope: com.uber.m3.tally.Scope

    Get scope for reporting business metrics in workflow logic.

    Get scope for reporting business metrics in workflow logic. This should be used instead of creating new metrics scopes as it is able to dedupe metrics during replay.

    The original metrics scope is set through ZWorkflowServiceStubsOptions.withMetricsScope when a worker starts up.

  29. def mutableSideEffect[R](id: String, updated: (R, R) => Boolean, f: () => R)(implicit javaTypeTag: JavaTypeTag[R]): R

    mutableSideEffect is similar to sideEffect in allowing calls of non-deterministic functions from workflow code.

    mutableSideEffect is similar to sideEffect in allowing calls of non-deterministic functions from workflow code.

    The difference between mutableSideEffect and sideEffect is that every new sideEffect call in non-replay mode results in a new marker event recorded into the history. However, mutableSideEffect only records a new marker if a value has changed. During the replay, mutableSideEffect will not execute the function again, but it will return the exact same value as it was returning during the non-replay run.

    One good use case of mutableSideEffect is to access a dynamically changing config without breaking determinism. Even if called very frequently the config value is recorded only when it changes not causing any performance degradation due to a large history size.

    Caution: do not use mutableSideEffect function to modify any workflow state. Only use the mutableSideEffect's return value.

    If function throws any exception it is not delivered to the workflow code. It is wrapped in Error causing failure of the current workflow task.

    R

    side effect result type

    id

    unique identifier of this side effect

    updated

    used to decide if a new value should be recorded. A func result is recorded only if call to updated with stored and a new value as arguments returns true. It is not called for the first value.

    f

    function that produces a value. This function can contain non-deterministic code.

    See also

    sideEffect

  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. def newActivityStub[A](options: ZActivityOptions)(implicit arg0: ClassTag[A], arg1: IsActivity[A]): activity.ZActivityStub.Of[A]

    Creates a builder of client stub to activities that implement given interface.

    Creates a builder of client stub to activities that implement given interface.

    A

    activity interface

    options

    activity options

    returns

    activity stub builder

  32. def newCancellationScope[U](thunk: (ZCancellationScope) => U): ZCancellationScope

    Wraps a procedure in a CancellationScope.

    Wraps a procedure in a CancellationScope. The procedure receives the wrapping CancellationScope as a parameter. Useful when cancellation is requested from within the wrapped code. The following example cancels the sibling activity on any failure.

    thunk

    code to wrap in the cancellation scope

    returns

    wrapped proc

    See also

    Workflow.newCancellationScope

  33. def newCancellationScope[U](thunk: => U): ZCancellationScope

    Wraps a procedure in a CancellationScope.

    Wraps a procedure in a CancellationScope. The procedure receives the wrapping CancellationScope as a parameter. Useful when cancellation is requested from within the wrapped code. The following example cancels the sibling activity on any failure.

    thunk

    code to wrap in the cancellation scope

    returns

    wrapped proc

    See also

    Workflow.newCancellationScope

  34. def newChildWorkflowStub[A](options: ZChildWorkflowOptions)(implicit arg0: ClassTag[A], arg1: IsWorkflow[A]): ZChildWorkflowStub.Of[A]

    Creates client stub that can be used to start a child workflow that implements given interface.

    Creates client stub that can be used to start a child workflow that implements given interface. Use newExternalWorkflowStub to get a stub to signal a workflow without starting it.

    A

    interface type implemented by activities

    options

    options passed to the child workflow.

  35. def newContinueAsNewStub[A](options: ZContinueAsNewOptions = ZContinueAsNewOptions.default)(implicit arg0: ClassTag[A], arg1: IsWorkflow[A]): ZWorkflowContinueAsNewStub.Of[A]

    Continues the current workflow execution as a new run possibly overriding the workflow type and options.

    Continues the current workflow execution as a new run possibly overriding the workflow type and options.

    A

    workflow type override for the next run, can be null of no override is needed

    options

    option overrides for the next run, can be null if no overrides are needed

  36. def newDetachedCancellationScope[U](thunk: => U): ZCancellationScope

    Creates a CancellationScope that is not linked to a parent scope.

    Creates a CancellationScope that is not linked to a parent scope. ZCancellationScope.run() must be called to execute the code the scope wraps. The detached scope is needed to execute cleanup code after a workflow is canceled which cancels the root scope that wraps the @WorkflowMethod invocation. Here is an example usage:

    thunk

    parameter to wrap in a cancellation scope.

    returns

    wrapped parameter.

    See also

    Workflow.newDetachedCancellationScope

  37. def newExternalWorkflowStub[A](workflowExecution: ZWorkflowExecution)(implicit arg0: ClassTag[A], arg1: IsWorkflow[A]): ZExternalWorkflowStub.Of[A]

    Creates client stub that can be used to signal or cancel an existing workflow

    Creates client stub that can be used to signal or cancel an existing workflow

    A

    workflow interface

    workflowExecution

    execution of the workflow to communicate with.

    returns

    external workflow stub

  38. def newExternalWorkflowStub[A](workflowId: String)(implicit arg0: ClassTag[A], arg1: IsWorkflow[A]): ZExternalWorkflowStub.Of[A]

    Creates client stub that can be used to signal or cancel an existing workflow

    Creates client stub that can be used to signal or cancel an existing workflow

    A

    workflow interface

    workflowId

    id of the workflow to communicate with.

    returns

    external workflow stub

  39. def newLocalActivityStub[A](options: ZLocalActivityOptions)(implicit arg0: ClassTag[A], arg1: IsActivity[A]): activity.ZActivityStub.Of[A]

    Creates a builder of client stub to local activities that implement given interface.

    Creates a builder of client stub to local activities that implement given interface.

    A

    activity interface

    options

    local activity options

    returns

    local activity stub builder

  40. def newRandom: scala.util.Random

    Replay safe random numbers generator.

    Replay safe random numbers generator. Seeded differently for each workflow instance.

  41. def newTimer(delay: zio.Duration): ZAsync[Unit]

    Create new timer.

    Create new timer. Note that Temporal service time resolution is in seconds. So all durations are rounded up to the nearest second.

    returns

    ZAsync that becomes ready when at least specified number of seconds passes. It is failed with zio.temporal.failure.CanceledFailure if enclosing scope is canceled.

  42. def newUntypedActivityStub(options: ZActivityOptions): Untyped

    Creates a builder of untyped client stub to activities

    Creates a builder of untyped client stub to activities

    options

    activity options

    returns

    untyped activity stub builder

  43. def newUntypedChildWorkflowStub(workflowType: String, options: ZChildWorkflowOptions): Untyped

    Creates untyped client stub that can be used to start and signal a child workflow.

    Creates untyped client stub that can be used to start and signal a child workflow.

    workflowType

    name of the workflow type to start.

    options

    options passed to the child workflow.

  44. def newUntypedExternalWorkflowStub(workflowExecution: ZWorkflowExecution): Untyped

    Creates untyped client stub that can be used to signal or cancel an existing workflow

    Creates untyped client stub that can be used to signal or cancel an existing workflow

    workflowExecution

    execution of the workflow to communicate with.

    returns

    external workflow stub

  45. def newUntypedExternalWorkflowStub(workflowId: String): Untyped

    Creates untyped client stub that can be used to signal or cancel an existing workflow

    Creates untyped client stub that can be used to signal or cancel an existing workflow

    workflowId

    id of the workflow to communicate with.

    returns

    external workflow stub

  46. def newUntypedLocalActivityStub(options: ZLocalActivityOptions): Untyped

    Creates a builder of untyped client stub to local activities that implement given interface.

    Creates a builder of untyped client stub to local activities that implement given interface.

    options

    local activity options

    returns

    local activity stub builder

  47. def newWorkflowQueue[E](capacity: Int): ZWorkflowQueue[E]

    Create a new instance of a ZWorkflowQueue implementation that is adapted to be used from a workflow code.

    Create a new instance of a ZWorkflowQueue implementation that is adapted to be used from a workflow code.

    E

    type of queue elements

    capacity

    the maximum size of the queue

    returns

    new instance of ZWorkflowQueue

  48. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  49. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  50. def randomUUID: UUID

    Generated random UUID

    Generated random UUID

    Should be used instead of UUID.randomUUID() to guarantee determinism

    returns

    generated UUID

    See also

    Workflow.randomUUID()

  51. def retry[R](options: ZRetryOptions, expiration: Option[zio.Duration] = None)(f: => R): R

    Invokes function retrying in case of failures according to retry options.

    Invokes function retrying in case of failures according to retry options. Synchronous variant.

    options

    retry options that specify retry policy

    expiration

    stop retrying after this interval if provided

    f

    function to invoke and retry

    returns

    result of the function or the last failure.

  52. def setDefaultActivityOptions(value: ZActivityOptions): Unit

    Sets the default activity options that will be used for activity stubs that have no ZActivityOptions specified.
    This overrides a value provided by zio.temporal.worker.ZWorkflowImplementationOptions.defaultActivityOptions.
    A more specific per-activity-type option specified in zio.temporal.worker.ZWorkflowImplementationOptions.activityOptions or applyActivityOptions takes precedence over this setting.

    Sets the default activity options that will be used for activity stubs that have no ZActivityOptions specified.
    This overrides a value provided by zio.temporal.worker.ZWorkflowImplementationOptions.defaultActivityOptions.
    A more specific per-activity-type option specified in zio.temporal.worker.ZWorkflowImplementationOptions.activityOptions or applyActivityOptions takes precedence over this setting.

    value

    ZActivityOptions to be used as a default

  53. def setDefaultLocalActivityOptions(value: ZLocalActivityOptions): Unit

    Sets the default local activity options that will be used for activity stubs that have no ZLocalActivityOptions specified.
    This overrides a value provided by zio.temporal.worker.ZWorkflowImplementationOptions.defaultLocalActivityOptions.
    A more specific per-activity-type option specified in zio.temporal.worker.ZWorkflowImplementationOptions.localActivityOptions or applyLocalActivityOptions takes precedence over this setting.

    Sets the default local activity options that will be used for activity stubs that have no ZLocalActivityOptions specified.
    This overrides a value provided by zio.temporal.worker.ZWorkflowImplementationOptions.defaultLocalActivityOptions.
    A more specific per-activity-type option specified in zio.temporal.worker.ZWorkflowImplementationOptions.localActivityOptions or applyLocalActivityOptions takes precedence over this setting.

    value

    ZLocalActivityOptions to be used as a default

  54. def sideEffect[R](f: () => R)(implicit javaTypeTag: JavaTypeTag[R]): R

    Executes the provided function once, records its result into the workflow history.

    Executes the provided function once, records its result into the workflow history. The recorded result on history will be returned without executing the provided function during replay. This guarantees the deterministic requirement for workflow as the exact same result will be returned in replay. Common use case is to run some short non-deterministic code in workflow, like getting random number. The only way to fail SideEffect is to panic which causes workflow task failure. The workflow task after timeout is rescheduled and re-executed giving SideEffect another chance to succeed.

    If function throws any exception it is not delivered to the workflow code. It is wrapped in Error causing failure of the current workflow task.

    R

    side effect result type

    f

    function that returns side effect value

    returns

    value of the side effect

    See also

    mutableSideEffect

  55. def sleep(duration: zio.Duration): Unit

    Suspends workflow execution until the given duration elapsed

    Suspends workflow execution until the given duration elapsed

    duration

    time to sleep

    returns

    unblocks when duration elapsed

    See also

    Workflow.sleep

  56. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  57. def toString(): String
    Definition Classes
    AnyRef → Any
  58. def typedSearchAttributes: ZSearchAttributes

    Get immutable set of search attributes.

    Get immutable set of search attributes. To modify search attributes associated with this workflow use upsertSearchAttributes

    returns

    immutable set of search attributes.

  59. def upsertSearchAttributes(attrs: Map[String, ZSearchAttribute]): Unit

    Adds or updates workflow search attributes.

    Adds or updates workflow search attributes.

    attrs

    map of String to ZSearchAttribute value that can be used to search in list APIs

    See also

    Workflow.upsertTypedSearchAttributes

  60. def version(changeId: String, minSupported: Int, maxSupported: Int): Int

    Returns current workflow version

    Returns current workflow version

    changeId

    identifier of a particular change. All calls to getVersion that share a changeId are guaranteed to return the same version number. Use this to perform multiple coordinated changes that should be enabled together.

    minSupported

    min version supported for the change

    maxSupported

    max version supported for the change

    returns

    version

    See also

    Workflow.getVersion

  61. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  62. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  63. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def newActivityStub[A](implicit arg0: ClassTag[A], arg1: IsActivity[A]): Of[A]

    Creates a builder of client stub to activities that implement given interface.

    Creates a builder of client stub to activities that implement given interface.

    A

    activity interface

    returns

    activity stub builder

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0) Use newActivityStub accepting ZActivityOptions

  3. def newChildWorkflowStub[A](implicit arg0: ClassTag[A], arg1: IsWorkflow[A]): Of[A]

    Creates a builder of client stub that can be used to start a child workflow that implements given interface.

    Creates a builder of client stub that can be used to start a child workflow that implements given interface.

    A

    workflow interface

    returns

    child workflow stub builder

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0) Use newChildWorkflowStub accepting ZChildWorkflowOptions

  4. def newContinueAsNewStub[A](implicit arg0: ClassTag[A], arg1: IsWorkflow[A]): ZWorkflowContinueAsNewStubBuilder[A]

    Creates a client stub that can be used to continue this workflow as a new run.

    Creates a client stub that can be used to continue this workflow as a new run.

    A

    an interface type implemented by the next run of the workflow

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0) Use newContinueAsNewStub accepting ZContinueAsNewOptions

  5. def newLocalActivityStub[A](implicit arg0: ClassTag[A], arg1: IsActivity[A]): Of[A]

    Creates a builder of client stub to local activities that implement given interface.

    Creates a builder of client stub to local activities that implement given interface.

    A

    activity interface

    returns

    local activity stub builder

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0) Use newLocalActivityStub accepting ZLocalActivityOptions

  6. def newUntypedActivityStub: Untyped

    Creates a builder of untyped client stub to activities

    Creates a builder of untyped client stub to activities

    returns

    untyped activity stub builder

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0) Use newUntypedActivityStub accepting ZActivityOptions

  7. def newUntypedChildWorkflowStub(workflowType: String): Untyped

    Creates a builder of untyped client stub that can be used to start a child workflow that implements given interface.

    Creates a builder of untyped client stub that can be used to start a child workflow that implements given interface.

    returns

    child workflow stub builder

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0) Use newUntypedChildWorkflowStub accepting ZChildWorkflowOptions

  8. def newUntypedLocalActivityStub: Untyped

    Creates a builder of untyped client stub to local activities that implement given interface.

    Creates a builder of untyped client stub to local activities that implement given interface.

    returns

    local activity stub builder

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0) Use newUntypedLocalActivityStub accepting ZLocalActivityOptions

Inherited from AnyRef

Inherited from Any

Ungrouped