Interface ActivityClient


@Experimental public interface ActivityClient
Client for managing standalone activity executions. Obtain an instance via newInstance(WorkflowServiceStubs) or newInstance(WorkflowServiceStubs, ActivityClientOptions).

Standalone activities run independently of any workflow. They are scheduled, monitored, and managed directly through this client rather than from within a workflow execution.

The primary typed API uses Class<I> together with unbound method references so the SDK can infer the activity type name and result type automatically:


 // Synchronous:
 String result = client.execute(MyActivity.class, MyActivity::activity, options, 1, 2);

 // Async handle:
 ActivityHandle<String> handle = client.start(MyActivity.class, MyActivity::activity, options, 1, 2);

 // Async future:
 CompletableFuture<String> fut = client.executeAsync(MyActivity.class, MyActivity::activity, options, 1, 2);

 // String-based:
 String result = client.execute("MyActivityType", String.class, options, 1, 2);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the count of activity executions matching the given query.
    default <I, R> R
    execute(Class<I> activityInterface, Functions.Func1<I,R> activity, StartActivityOptions options)
    Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, blocks until it completes, and returns the typed result.
    default <I, A1, R> R
    execute(Class<I> activityInterface, Functions.Func2<I,A1,R> activity, StartActivityOptions options, A1 arg1)
    Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, blocks until it completes, and returns the typed result.
    default <I, A1, A2, R>
    R
    execute(Class<I> activityInterface, Functions.Func3<I,A1,A2,R> activity, StartActivityOptions options, A1 arg1, A2 arg2)
    Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, blocks until it completes, and returns the typed result.
    default <I, A1, A2, A3, R>
    R
    execute(Class<I> activityInterface, Functions.Func4<I,A1,A2,A3,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
    Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, blocks until it completes, and returns the typed result.
    default <I, A1, A2, A3, A4, R>
    R
    execute(Class<I> activityInterface, Functions.Func5<I,A1,A2,A3,A4,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
    Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, blocks until it completes, and returns the typed result.
    default <I, A1, A2, A3, A4, A5, R>
    R
    execute(Class<I> activityInterface, Functions.Func6<I,A1,A2,A3,A4,A5,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
    Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, blocks until it completes, and returns the typed result.
    default <I, A1, A2, A3, A4, A5, A6, R>
    R
    execute(Class<I> activityInterface, Functions.Func7<I,A1,A2,A3,A4,A5,A6,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
    Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, blocks until it completes, and returns the typed result.
    default <I> void
    execute(Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options)
    Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, and blocks until it completes.
    default <I, A1> void
    execute(Class<I> activityInterface, Functions.Proc2<I,A1> activity, StartActivityOptions options, A1 arg1)
    Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, and blocks until it completes.
    default <I, A1, A2>
    void
    execute(Class<I> activityInterface, Functions.Proc3<I,A1,A2> activity, StartActivityOptions options, A1 arg1, A2 arg2)
    Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, and blocks until it completes.
    default <I, A1, A2, A3>
    void
    execute(Class<I> activityInterface, Functions.Proc4<I,A1,A2,A3> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
    Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, and blocks until it completes.
    default <I, A1, A2, A3, A4>
    void
    execute(Class<I> activityInterface, Functions.Proc5<I,A1,A2,A3,A4> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
    Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, and blocks until it completes.
    default <I, A1, A2, A3, A4, A5>
    void
    execute(Class<I> activityInterface, Functions.Proc6<I,A1,A2,A3,A4,A5> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
    Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, and blocks until it completes.
    default <I, A1, A2, A3, A4, A5, A6>
    void
    execute(Class<I> activityInterface, Functions.Proc7<I,A1,A2,A3,A4,A5,A6> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
    Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, and blocks until it completes.
    default void
    execute(String activityType, StartActivityOptions options, Object... args)
    Starts a standalone activity and blocks until it completes, discarding the result.
    default <R> R
    execute(String activityType, Class<R> resultClass, StartActivityOptions options, Object... args)
    Starts a standalone activity and blocks until it completes, returning the typed result.
    default <R> R
    execute(String activityType, Class<R> resultClass, Type resultType, StartActivityOptions options, Object... args)
    Starts a standalone activity and blocks until it completes, for generic result types.
    default <I, R> CompletableFuture<R>
    executeAsync(Class<I> activityInterface, Functions.Func1<I,R> activity, StartActivityOptions options)
    Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, and returns a future that resolves to the typed result.
    default <I, A1, R> CompletableFuture<R>
    executeAsync(Class<I> activityInterface, Functions.Func2<I,A1,R> activity, StartActivityOptions options, A1 arg1)
    Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, and returns a future that resolves to the typed result.
    default <I, A1, A2, R>
    CompletableFuture<R>
    executeAsync(Class<I> activityInterface, Functions.Func3<I,A1,A2,R> activity, StartActivityOptions options, A1 arg1, A2 arg2)
    Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, and returns a future that resolves to the typed result.
    default <I, A1, A2, A3, R>
    CompletableFuture<R>
    executeAsync(Class<I> activityInterface, Functions.Func4<I,A1,A2,A3,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
    Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, and returns a future that resolves to the typed result.
    default <I, A1, A2, A3, A4, R>
    CompletableFuture<R>
    executeAsync(Class<I> activityInterface, Functions.Func5<I,A1,A2,A3,A4,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
    Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, and returns a future that resolves to the typed result.
    default <I, A1, A2, A3, A4, A5, R>
    CompletableFuture<R>
    executeAsync(Class<I> activityInterface, Functions.Func6<I,A1,A2,A3,A4,A5,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
    Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, and returns a future that resolves to the typed result.
    default <I, A1, A2, A3, A4, A5, A6, R>
    CompletableFuture<R>
    executeAsync(Class<I> activityInterface, Functions.Func7<I,A1,A2,A3,A4,A5,A6,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
    Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, and returns a future that resolves to the typed result.
    default <I> CompletableFuture<Void>
    executeAsync(Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options)
    Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, and returns a future that completes when the activity does.
    default <I, A1> CompletableFuture<Void>
    executeAsync(Class<I> activityInterface, Functions.Proc2<I,A1> activity, StartActivityOptions options, A1 arg1)
    Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, and returns a future that completes when the activity does.
    default <I, A1, A2>
    CompletableFuture<Void>
    executeAsync(Class<I> activityInterface, Functions.Proc3<I,A1,A2> activity, StartActivityOptions options, A1 arg1, A2 arg2)
    Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, and returns a future that completes when the activity does.
    default <I, A1, A2, A3>
    CompletableFuture<Void>
    executeAsync(Class<I> activityInterface, Functions.Proc4<I,A1,A2,A3> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
    Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, and returns a future that completes when the activity does.
    default <I, A1, A2, A3, A4>
    CompletableFuture<Void>
    executeAsync(Class<I> activityInterface, Functions.Proc5<I,A1,A2,A3,A4> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
    Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, and returns a future that completes when the activity does.
    default <I, A1, A2, A3, A4, A5>
    CompletableFuture<Void>
    executeAsync(Class<I> activityInterface, Functions.Proc6<I,A1,A2,A3,A4,A5> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
    Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, and returns a future that completes when the activity does.
    default <I, A1, A2, A3, A4, A5, A6>
    CompletableFuture<Void>
    executeAsync(Class<I> activityInterface, Functions.Proc7<I,A1,A2,A3,A4,A5,A6> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
    Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, and returns a future that completes when the activity does.
    executeAsync(String activityType, StartActivityOptions options, Object... args)
    Starts a standalone activity and returns a future that completes when the activity does, discarding the result.
    default <R> CompletableFuture<R>
    executeAsync(String activityType, Class<R> resultClass, StartActivityOptions options, Object... args)
    Starts a standalone activity and returns a future that completes with the typed result.
    default <R> CompletableFuture<R>
    executeAsync(String activityType, Class<R> resultClass, Type resultType, StartActivityOptions options, Object... args)
    Starts a standalone activity and returns a future, for generic result types.
    getHandle(String activityId, String activityRunId)
    Returns an untyped handle to an existing standalone activity execution.
    getHandle(String activityId, String activityRunId, Class<R> resultClass)
    Returns a typed handle to an existing standalone activity execution.
    getHandle(String activityId, String activityRunId, Class<R> resultClass, Type resultType)
    Returns a typed handle to an existing standalone activity execution for generic result types.
    Returns a stream of activity executions matching the given query.
    Creates a new ActivityCompletionClient for completing activities asynchronously using a task token or activity ID.
    newInstance(io.temporal.serviceclient.WorkflowServiceStubs stubs)
    Creates a new ActivityClient with default options.
    newInstance(io.temporal.serviceclient.WorkflowServiceStubs stubs, ActivityClientOptions options)
    Creates a new ActivityClient with the given options.
    <I, R> ActivityHandle<R>
    start(Class<I> activityInterface, Functions.Func1<I,R> activity, StartActivityOptions options)
    Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, returning a typed result.
    <I, A1, R> ActivityHandle<R>
    start(Class<I> activityInterface, Functions.Func2<I,A1,R> activity, StartActivityOptions options, A1 arg1)
    Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, returning a typed result.
    <I, A1, A2, R>
    ActivityHandle<R>
    start(Class<I> activityInterface, Functions.Func3<I,A1,A2,R> activity, StartActivityOptions options, A1 arg1, A2 arg2)
    Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, returning a typed result.
    <I, A1, A2, A3, R>
    ActivityHandle<R>
    start(Class<I> activityInterface, Functions.Func4<I,A1,A2,A3,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
    Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, returning a typed result.
    <I, A1, A2, A3, A4, R>
    ActivityHandle<R>
    start(Class<I> activityInterface, Functions.Func5<I,A1,A2,A3,A4,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
    Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, returning a typed result.
    <I, A1, A2, A3, A4, A5, R>
    ActivityHandle<R>
    start(Class<I> activityInterface, Functions.Func6<I,A1,A2,A3,A4,A5,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
    Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, returning a typed result.
    <I, A1, A2, A3, A4, A5, A6, R>
    ActivityHandle<R>
    start(Class<I> activityInterface, Functions.Func7<I,A1,A2,A3,A4,A5,A6,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
    Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, returning a typed result.
    start(Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options)
    Starts a standalone activity using a typed interface and an unbound method reference, and returns a typed handle.
    start(Class<I> activityInterface, Functions.Proc2<I,A1> activity, StartActivityOptions options, A1 arg1)
    Starts a standalone activity using a typed interface and an unbound method reference with one activity argument.
    <I, A1, A2>
    ActivityHandle<Void>
    start(Class<I> activityInterface, Functions.Proc3<I,A1,A2> activity, StartActivityOptions options, A1 arg1, A2 arg2)
    Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments.
    <I, A1, A2, A3>
    ActivityHandle<Void>
    start(Class<I> activityInterface, Functions.Proc4<I,A1,A2,A3> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
    Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments.
    <I, A1, A2, A3, A4>
    ActivityHandle<Void>
    start(Class<I> activityInterface, Functions.Proc5<I,A1,A2,A3,A4> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
    Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments.
    <I, A1, A2, A3, A4, A5>
    ActivityHandle<Void>
    start(Class<I> activityInterface, Functions.Proc6<I,A1,A2,A3,A4,A5> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
    Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments.
    <I, A1, A2, A3, A4, A5, A6>
    ActivityHandle<Void>
    start(Class<I> activityInterface, Functions.Proc7<I,A1,A2,A3,A4,A5,A6> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
    Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments.
    start(String activityType, StartActivityOptions options, Object... args)
    Starts a standalone activity by type name and returns an untyped handle to it.
    start(String activityType, Class<R> resultClass, StartActivityOptions options, Object... args)
    Starts a standalone activity by type name and returns a typed handle.
    start(String activityType, Class<R> resultClass, Type resultType, StartActivityOptions options, Object... args)
    Starts a standalone activity by type name and returns a typed handle for generic result types.
  • Method Details

    • newInstance

      static ActivityClient newInstance(io.temporal.serviceclient.WorkflowServiceStubs stubs)
      Creates a new ActivityClient with default options.
    • newInstance

      static ActivityClient newInstance(io.temporal.serviceclient.WorkflowServiceStubs stubs, ActivityClientOptions options)
      Creates a new ActivityClient with the given options.
    • start

      <I> ActivityHandle<Void> start(Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options)
      Starts a standalone activity using a typed interface and an unbound method reference, and returns a typed handle.

      Example:

      
       ActivityHandle<Void> handle = client.start(MyActivity.class, MyActivity::doWork, options);
       
      Type Parameters:
      I - the activity interface type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with no activity arguments
      options - scheduling options
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1> ActivityHandle<Void> start(Class<I> activityInterface, Functions.Proc2<I,A1> activity, StartActivityOptions options, A1 arg1)
      Starts a standalone activity using a typed interface and an unbound method reference with one activity argument.

      Example:

      
       ActivityHandle<Void> handle = client.start(MyActivity.class, MyActivity::doWork, options, "arg1");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with one activity argument
      options - scheduling options
      arg1 - first activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2> ActivityHandle<Void> start(Class<I> activityInterface, Functions.Proc3<I,A1,A2> activity, StartActivityOptions options, A1 arg1, A2 arg2)
      Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments.

      Example:

      
       ActivityHandle<Void> handle = client.start(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with two activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2, A3> ActivityHandle<Void> start(Class<I> activityInterface, Functions.Proc4<I,A1,A2,A3> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
      Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments.

      Example:

      
       ActivityHandle<Void> handle = client.start(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with three activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2, A3, A4> ActivityHandle<Void> start(Class<I> activityInterface, Functions.Proc5<I,A1,A2,A3,A4> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
      Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments.

      Example:

      
       ActivityHandle<Void> handle = client.start(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3", "arg4");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with four activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2, A3, A4, A5> ActivityHandle<Void> start(Class<I> activityInterface, Functions.Proc6<I,A1,A2,A3,A4,A5> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
      Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments.

      Example:

      
       ActivityHandle<Void> handle = client.start(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3", "arg4", "arg5");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with five activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2, A3, A4, A5, A6> ActivityHandle<Void> start(Class<I> activityInterface, Functions.Proc7<I,A1,A2,A3,A4,A5,A6> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
      Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments.

      Example:

      
       ActivityHandle<Void> handle = client.start(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3", "arg4", "arg5", "arg6");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      A6 - the type of the sixth activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with six activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      arg6 - sixth activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, R> ActivityHandle<R> start(Class<I> activityInterface, Functions.Func1<I,R> activity, StartActivityOptions options)
      Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, returning a typed result.

      Example:

      
       ActivityHandle<String> handle = client.start(MyActivity.class, MyActivity::greet, options);
       
      Type Parameters:
      I - the activity interface type
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with no activity arguments
      options - scheduling options
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, R> ActivityHandle<R> start(Class<I> activityInterface, Functions.Func2<I,A1,R> activity, StartActivityOptions options, A1 arg1)
      Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, returning a typed result.

      Example:

      
       ActivityHandle<String> handle = client.start(MyActivity.class, MyActivity::greet, options, "arg1");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with one activity argument
      options - scheduling options
      arg1 - first activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2, R> ActivityHandle<R> start(Class<I> activityInterface, Functions.Func3<I,A1,A2,R> activity, StartActivityOptions options, A1 arg1, A2 arg2)
      Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, returning a typed result.

      Example:

      
       ActivityHandle<String> handle = client.start(MyActivity.class, MyActivity::greet, options, "arg1", "arg2");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with two activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2, A3, R> ActivityHandle<R> start(Class<I> activityInterface, Functions.Func4<I,A1,A2,A3,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
      Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, returning a typed result.

      Example:

      
       ActivityHandle<String> handle = client.start(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with three activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2, A3, A4, R> ActivityHandle<R> start(Class<I> activityInterface, Functions.Func5<I,A1,A2,A3,A4,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
      Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, returning a typed result.

      Example:

      
       ActivityHandle<String> handle = client.start(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3", "arg4");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with four activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2, A3, A4, A5, R> ActivityHandle<R> start(Class<I> activityInterface, Functions.Func6<I,A1,A2,A3,A4,A5,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
      Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, returning a typed result.

      Example:

      
       ActivityHandle<String> handle = client.start(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3", "arg4", "arg5");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with five activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <I, A1, A2, A3, A4, A5, A6, R> ActivityHandle<R> start(Class<I> activityInterface, Functions.Func7<I,A1,A2,A3,A4,A5,A6,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
      Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, returning a typed result.

      Example:

      
       ActivityHandle<String> handle = client.start(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3", "arg4", "arg5", "arg6");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      A6 - the type of the sixth activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with six activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      arg6 - sixth activity argument
      Returns:
      a typed handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • execute

      default <I> void execute(Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options)
      Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, and blocks until it completes.

      Example:

      
       client.execute(MyActivity.class, MyActivity::doWork, options);
       
      Type Parameters:
      I - the activity interface type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with no activity arguments
      options - scheduling options
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1> void execute(Class<I> activityInterface, Functions.Proc2<I,A1> activity, StartActivityOptions options, A1 arg1)
      Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, and blocks until it completes.

      Example:

      
       client.execute(MyActivity.class, MyActivity::doWork, options, "arg1");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with one activity argument
      options - scheduling options
      arg1 - first activity argument
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2> void execute(Class<I> activityInterface, Functions.Proc3<I,A1,A2> activity, StartActivityOptions options, A1 arg1, A2 arg2)
      Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, and blocks until it completes.

      Example:

      
       client.execute(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with two activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2, A3> void execute(Class<I> activityInterface, Functions.Proc4<I,A1,A2,A3> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
      Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, and blocks until it completes.

      Example:

      
       client.execute(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with three activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2, A3, A4> void execute(Class<I> activityInterface, Functions.Proc5<I,A1,A2,A3,A4> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
      Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, and blocks until it completes.

      Example:

      
       client.execute(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3", "arg4");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with four activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2, A3, A4, A5> void execute(Class<I> activityInterface, Functions.Proc6<I,A1,A2,A3,A4,A5> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
      Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, and blocks until it completes.

      Example:

      
       client.execute(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3", "arg4", "arg5");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with five activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2, A3, A4, A5, A6> void execute(Class<I> activityInterface, Functions.Proc7<I,A1,A2,A3,A4,A5,A6> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
      Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, and blocks until it completes.

      Example:

      
       client.execute(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3", "arg4", "arg5", "arg6");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      A6 - the type of the sixth activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with six activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      arg6 - sixth activity argument
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, R> R execute(Class<I> activityInterface, Functions.Func1<I,R> activity, StartActivityOptions options)
      Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, blocks until it completes, and returns the typed result.

      Example:

      
       String result = client.execute(MyActivity.class, MyActivity::greet, options);
       
      Type Parameters:
      I - the activity interface type
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with no activity arguments
      options - scheduling options
      Returns:
      the activity result
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, R> R execute(Class<I> activityInterface, Functions.Func2<I,A1,R> activity, StartActivityOptions options, A1 arg1)
      Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, blocks until it completes, and returns the typed result.

      Example:

      
       String result = client.execute(MyActivity.class, MyActivity::greet, options, "arg1");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with one activity argument
      options - scheduling options
      arg1 - first activity argument
      Returns:
      the activity result
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2, R> R execute(Class<I> activityInterface, Functions.Func3<I,A1,A2,R> activity, StartActivityOptions options, A1 arg1, A2 arg2)
      Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, blocks until it completes, and returns the typed result.

      Example:

      
       String result = client.execute(MyActivity.class, MyActivity::greet, options, "arg1", "arg2");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with two activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      Returns:
      the activity result
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2, A3, R> R execute(Class<I> activityInterface, Functions.Func4<I,A1,A2,A3,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
      Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, blocks until it completes, and returns the typed result.

      Example:

      
       String result = client.execute(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with three activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      Returns:
      the activity result
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2, A3, A4, R> R execute(Class<I> activityInterface, Functions.Func5<I,A1,A2,A3,A4,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
      Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, blocks until it completes, and returns the typed result.

      Example:

      
       String result = client.execute(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3", "arg4");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with four activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      Returns:
      the activity result
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2, A3, A4, A5, R> R execute(Class<I> activityInterface, Functions.Func6<I,A1,A2,A3,A4,A5,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
      Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, blocks until it completes, and returns the typed result.

      Example:

      
       String result = client.execute(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3", "arg4", "arg5");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with five activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      Returns:
      the activity result
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <I, A1, A2, A3, A4, A5, A6, R> R execute(Class<I> activityInterface, Functions.Func7<I,A1,A2,A3,A4,A5,A6,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
      Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, blocks until it completes, and returns the typed result.

      Example:

      
       String result = client.execute(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3", "arg4", "arg5", "arg6");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      A6 - the type of the sixth activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with six activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      arg6 - sixth activity argument
      Returns:
      the activity result
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • executeAsync

      default <I> CompletableFuture<Void> executeAsync(Class<I> activityInterface, Functions.Proc1<I> activity, StartActivityOptions options)
      Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, and returns a future that completes when the activity does.

      Example:

      
       CompletableFuture<Void> future = client.executeAsync(MyActivity.class, MyActivity::doWork, options);
       
      Type Parameters:
      I - the activity interface type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with no activity arguments
      options - scheduling options
      Returns:
      a future that completes when the activity completes
    • executeAsync

      default <I, A1> CompletableFuture<Void> executeAsync(Class<I> activityInterface, Functions.Proc2<I,A1> activity, StartActivityOptions options, A1 arg1)
      Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, and returns a future that completes when the activity does.

      Example:

      
       CompletableFuture<Void> future = client.executeAsync(MyActivity.class, MyActivity::doWork, options, "arg1");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with one activity argument
      options - scheduling options
      arg1 - first activity argument
      Returns:
      a future that completes when the activity completes
    • executeAsync

      default <I, A1, A2> CompletableFuture<Void> executeAsync(Class<I> activityInterface, Functions.Proc3<I,A1,A2> activity, StartActivityOptions options, A1 arg1, A2 arg2)
      Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, and returns a future that completes when the activity does.

      Example:

      
       CompletableFuture<Void> future = client.executeAsync(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with two activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      Returns:
      a future that completes when the activity completes
    • executeAsync

      default <I, A1, A2, A3> CompletableFuture<Void> executeAsync(Class<I> activityInterface, Functions.Proc4<I,A1,A2,A3> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
      Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, and returns a future that completes when the activity does.

      Example:

      
       CompletableFuture<Void> future = client.executeAsync(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with three activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      Returns:
      a future that completes when the activity completes
    • executeAsync

      default <I, A1, A2, A3, A4> CompletableFuture<Void> executeAsync(Class<I> activityInterface, Functions.Proc5<I,A1,A2,A3,A4> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
      Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, and returns a future that completes when the activity does.

      Example:

      
       CompletableFuture<Void> future = client.executeAsync(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3", "arg4");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with four activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      Returns:
      a future that completes when the activity completes
    • executeAsync

      default <I, A1, A2, A3, A4, A5> CompletableFuture<Void> executeAsync(Class<I> activityInterface, Functions.Proc6<I,A1,A2,A3,A4,A5> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
      Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, and returns a future that completes when the activity does.

      Example:

      
       CompletableFuture<Void> future = client.executeAsync(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3", "arg4", "arg5");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with five activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      Returns:
      a future that completes when the activity completes
    • executeAsync

      default <I, A1, A2, A3, A4, A5, A6> CompletableFuture<Void> executeAsync(Class<I> activityInterface, Functions.Proc7<I,A1,A2,A3,A4,A5,A6> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
      Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, and returns a future that completes when the activity does.

      Example:

      
       CompletableFuture<Void> future = client.executeAsync(MyActivity.class, MyActivity::doWork, options, "arg1", "arg2", "arg3", "arg4", "arg5", "arg6");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      A6 - the type of the sixth activity argument
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with six activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      arg6 - sixth activity argument
      Returns:
      a future that completes when the activity completes
    • executeAsync

      default <I, R> CompletableFuture<R> executeAsync(Class<I> activityInterface, Functions.Func1<I,R> activity, StartActivityOptions options)
      Starts a standalone activity using a typed interface and an unbound method reference with no activity arguments, and returns a future that resolves to the typed result.

      Example:

      
       CompletableFuture<String> future = client.executeAsync(MyActivity.class, MyActivity::greet, options);
       
      Type Parameters:
      I - the activity interface type
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with no activity arguments
      options - scheduling options
      Returns:
      a future that resolves to the activity result
    • executeAsync

      default <I, A1, R> CompletableFuture<R> executeAsync(Class<I> activityInterface, Functions.Func2<I,A1,R> activity, StartActivityOptions options, A1 arg1)
      Starts a standalone activity using a typed interface and an unbound method reference with one activity argument, and returns a future that resolves to the typed result.

      Example:

      
       CompletableFuture<String> future = client.executeAsync(MyActivity.class, MyActivity::greet, options, "arg1");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with one activity argument
      options - scheduling options
      arg1 - first activity argument
      Returns:
      a future that resolves to the activity result
    • executeAsync

      default <I, A1, A2, R> CompletableFuture<R> executeAsync(Class<I> activityInterface, Functions.Func3<I,A1,A2,R> activity, StartActivityOptions options, A1 arg1, A2 arg2)
      Starts a standalone activity using a typed interface and an unbound method reference with two activity arguments, and returns a future that resolves to the typed result.

      Example:

      
       CompletableFuture<String> future = client.executeAsync(MyActivity.class, MyActivity::greet, options, "arg1", "arg2");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with two activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      Returns:
      a future that resolves to the activity result
    • executeAsync

      default <I, A1, A2, A3, R> CompletableFuture<R> executeAsync(Class<I> activityInterface, Functions.Func4<I,A1,A2,A3,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3)
      Starts a standalone activity using a typed interface and an unbound method reference with three activity arguments, and returns a future that resolves to the typed result.

      Example:

      
       CompletableFuture<String> future = client.executeAsync(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with three activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      Returns:
      a future that resolves to the activity result
    • executeAsync

      default <I, A1, A2, A3, A4, R> CompletableFuture<R> executeAsync(Class<I> activityInterface, Functions.Func5<I,A1,A2,A3,A4,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
      Starts a standalone activity using a typed interface and an unbound method reference with four activity arguments, and returns a future that resolves to the typed result.

      Example:

      
       CompletableFuture<String> future = client.executeAsync(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3", "arg4");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with four activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      Returns:
      a future that resolves to the activity result
    • executeAsync

      default <I, A1, A2, A3, A4, A5, R> CompletableFuture<R> executeAsync(Class<I> activityInterface, Functions.Func6<I,A1,A2,A3,A4,A5,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
      Starts a standalone activity using a typed interface and an unbound method reference with five activity arguments, and returns a future that resolves to the typed result.

      Example:

      
       CompletableFuture<String> future = client.executeAsync(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3", "arg4", "arg5");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with five activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      Returns:
      a future that resolves to the activity result
    • executeAsync

      default <I, A1, A2, A3, A4, A5, A6, R> CompletableFuture<R> executeAsync(Class<I> activityInterface, Functions.Func7<I,A1,A2,A3,A4,A5,A6,R> activity, StartActivityOptions options, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
      Starts a standalone activity using a typed interface and an unbound method reference with six activity arguments, and returns a future that resolves to the typed result.

      Example:

      
       CompletableFuture<String> future = client.executeAsync(MyActivity.class, MyActivity::greet, options, "arg1", "arg2", "arg3", "arg4", "arg5", "arg6");
       
      Type Parameters:
      I - the activity interface type
      A1 - the type of the first activity argument
      A2 - the type of the second activity argument
      A3 - the type of the third activity argument
      A4 - the type of the fourth activity argument
      A5 - the type of the fifth activity argument
      A6 - the type of the sixth activity argument
      R - the activity result type
      Parameters:
      activityInterface - the activity interface class
      activity - unbound method reference with six activity arguments
      options - scheduling options
      arg1 - first activity argument
      arg2 - second activity argument
      arg3 - third activity argument
      arg4 - fourth activity argument
      arg5 - fifth activity argument
      arg6 - sixth activity argument
      Returns:
      a future that resolves to the activity result
    • start

      UntypedActivityHandle start(String activityType, StartActivityOptions options, @Nullable Object... args)
      Starts a standalone activity by type name and returns an untyped handle to it.
      Parameters:
      activityType - the registered activity type name
      options - scheduling options (task queue, timeouts, etc.)
      args - activity arguments
      Returns:
      an untyped handle to the started activity
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <R> ActivityHandle<R> start(String activityType, Class<R> resultClass, StartActivityOptions options, @Nullable Object... args)
      Starts a standalone activity by type name and returns a typed handle.
      Type Parameters:
      R - result type
      Parameters:
      activityType - the registered activity type name
      resultClass - expected result type
      options - scheduling options
      args - activity arguments
      Returns:
      a typed handle whose ActivityHandle.getResult() returns R
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • start

      <R> ActivityHandle<R> start(String activityType, Class<R> resultClass, Type resultType, StartActivityOptions options, @Nullable Object... args)
      Starts a standalone activity by type name and returns a typed handle for generic result types.
      Type Parameters:
      R - result type
      Parameters:
      activityType - the registered activity type name
      resultClass - expected result class
      resultType - generic type for deserialisation (e.g. from TypeToken.getType())
      options - scheduling options
      args - activity arguments
      Returns:
      a typed handle
      Throws:
      ActivityAlreadyStartedException - if an activity with the same ID is already running
    • execute

      default void execute(String activityType, StartActivityOptions options, @Nullable Object... args)
      Starts a standalone activity and blocks until it completes, discarding the result.
      Parameters:
      activityType - the registered activity type name
      options - scheduling options
      args - activity arguments
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <R> R execute(String activityType, Class<R> resultClass, StartActivityOptions options, @Nullable Object... args)
      Starts a standalone activity and blocks until it completes, returning the typed result.
      Type Parameters:
      R - result type
      Parameters:
      activityType - the registered activity type name
      resultClass - expected result type
      options - scheduling options
      args - activity arguments
      Returns:
      the activity result
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • execute

      default <R> R execute(String activityType, Class<R> resultClass, Type resultType, StartActivityOptions options, @Nullable Object... args)
      Starts a standalone activity and blocks until it completes, for generic result types.
      Type Parameters:
      R - result type
      Parameters:
      activityType - the registered activity type name
      resultClass - expected result class
      resultType - generic type for deserialisation
      options - scheduling options
      args - activity arguments
      Returns:
      the activity result
      Throws:
      ActivityFailedException - if the activity failed, timed out, or was cancelled
    • executeAsync

      default CompletableFuture<Void> executeAsync(String activityType, StartActivityOptions options, @Nullable Object... args)
      Starts a standalone activity and returns a future that completes when the activity does, discarding the result.
      Parameters:
      activityType - the registered activity type name
      options - scheduling options
      args - activity arguments
      Returns:
      a future that completes when the activity completes
    • executeAsync

      default <R> CompletableFuture<R> executeAsync(String activityType, Class<R> resultClass, StartActivityOptions options, @Nullable Object... args)
      Starts a standalone activity and returns a future that completes with the typed result.
      Type Parameters:
      R - result type
      Parameters:
      activityType - the registered activity type name
      resultClass - expected result type
      options - scheduling options
      args - activity arguments
      Returns:
      a future that resolves to the activity result
    • executeAsync

      default <R> CompletableFuture<R> executeAsync(String activityType, Class<R> resultClass, Type resultType, StartActivityOptions options, @Nullable Object... args)
      Starts a standalone activity and returns a future, for generic result types.
      Type Parameters:
      R - result type
      Parameters:
      activityType - the registered activity type name
      resultClass - expected result class
      resultType - generic type for deserialisation
      options - scheduling options
      args - activity arguments
      Returns:
      a future that resolves to the activity result
    • getHandle

      UntypedActivityHandle getHandle(String activityId, @Nullable String activityRunId)
      Returns an untyped handle to an existing standalone activity execution.
      Parameters:
      activityId - the user-assigned activity ID
      activityRunId - the server-assigned run ID, or null to target any run
      Returns:
      an untyped handle
    • getHandle

      <R> ActivityHandle<R> getHandle(String activityId, @Nullable String activityRunId, Class<R> resultClass)
      Returns a typed handle to an existing standalone activity execution.
      Type Parameters:
      R - result type
      Parameters:
      activityId - the user-assigned activity ID
      activityRunId - the server-assigned run ID, or null to target any run
      resultClass - expected result type
      Returns:
      a typed handle
    • getHandle

      <R> ActivityHandle<R> getHandle(String activityId, @Nullable String activityRunId, Class<R> resultClass, @Nullable Type resultType)
      Returns a typed handle to an existing standalone activity execution for generic result types.
      Type Parameters:
      R - result type
      Parameters:
      activityId - the user-assigned activity ID
      activityRunId - the server-assigned run ID, or null to target any run
      resultClass - expected result class
      resultType - generic type for deserialisation; may be null
      Returns:
      a typed handle
    • listExecutions

      Stream<ActivityExecutionMetadata> listExecutions(String query)
      Returns a stream of activity executions matching the given query.
      Parameters:
      query - Temporal visibility query string
      Returns:
      stream of matching activity executions
    • countExecutions

      ActivityExecutionCount countExecutions(String query)
      Returns the count of activity executions matching the given query.
      Parameters:
      query - Temporal visibility query string
      Returns:
      execution count, optionally with aggregation groups
    • newActivityCompletionClient

      ActivityCompletionClient newActivityCompletionClient()
      Creates a new ActivityCompletionClient for completing activities asynchronously using a task token or activity ID.
      Returns:
      a new completion client