Interface ActivityClient
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 TypeMethodDescriptioncountExecutions(String query) 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>
Rexecute(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>
Rexecute(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>
Rexecute(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>
Rexecute(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>
Rexecute(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> voidexecute(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>
voidexecute(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>
voidexecute(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>
voidexecute(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>
voidexecute(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>
voidexecute(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 voidexecute(String activityType, StartActivityOptions options, Object... args) Starts a standalone activity and blocks until it completes, discarding the result.default <R> Rexecute(String activityType, Class<R> resultClass, StartActivityOptions options, Object... args) Starts a standalone activity and blocks until it completes, returning the typed result.default <R> Rexecute(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.default CompletableFuture<Void> 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.Returns an untyped handle to an existing standalone activity execution.<R> ActivityHandle<R> Returns a typed handle to an existing standalone activity execution.<R> ActivityHandle<R> Returns a typed handle to an existing standalone activity execution for generic result types.listExecutions(String query) Returns a stream of activity executions matching the given query.Creates a newActivityCompletionClientfor completing activities asynchronously using a task token or activity ID.static ActivityClientnewInstance(io.temporal.serviceclient.WorkflowServiceStubs stubs) Creates a newActivityClientwith default options.static ActivityClientnewInstance(io.temporal.serviceclient.WorkflowServiceStubs stubs, ActivityClientOptions options) Creates a newActivityClientwith 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.<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.<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.<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.<R> ActivityHandle<R> start(String activityType, Class<R> resultClass, StartActivityOptions options, Object... args) Starts a standalone activity by type name and returns a typed handle.<R> ActivityHandle<R> 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
Creates a newActivityClientwith default options. -
newInstance
static ActivityClient newInstance(io.temporal.serviceclient.WorkflowServiceStubs stubs, ActivityClientOptions options) Creates a newActivityClientwith 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 classactivity- unbound method reference with no activity argumentsoptions- 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 typeA1- the type of the first activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with one activity argumentoptions- scheduling optionsarg1- 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, ActivityHandle<Void> startA2> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with two activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- 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, ActivityHandle<Void> startA2, A3> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with three activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- 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, ActivityHandle<Void> startA2, A3, A4> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with four activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- 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, ActivityHandle<Void> startA2, A3, A4, A5> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with five activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- 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, ActivityHandle<Void> startA2, A3, A4, A5, A6> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argumentA6- the type of the sixth activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with six activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argumentarg6- 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 typeR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with no activity argumentsoptions- 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<R> startR> (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 typeA1- the type of the first activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with one activity argumentoptions- scheduling optionsarg1- 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, ActivityHandle<R> startA2, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with two activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- 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, ActivityHandle<R> startA2, A3, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with three activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- 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, ActivityHandle<R> startA2, A3, A4, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with four activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- 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, ActivityHandle<R> startA2, A3, A4, A5, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with five activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- 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, ActivityHandle<R> startA2, A3, A4, A5, A6, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argumentA6- the type of the sixth activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with six activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argumentarg6- 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 classactivity- unbound method reference with no activity argumentsoptions- 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 typeA1- the type of the first activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with one activity argumentoptions- scheduling optionsarg1- first activity argument- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, void executeA2> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with two activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argument- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, void executeA2, A3> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with three activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argument- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, void executeA2, A3, A4> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with four activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argument- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, void executeA2, A3, A4, A5> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with five activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argument- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, void executeA2, A3, A4, A5, A6> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argumentA6- the type of the sixth activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with six activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argumentarg6- 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 typeR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with no activity argumentsoptions- scheduling options- Returns:
- the activity result
- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, R executeR> (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 typeA1- the type of the first activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with one activity argumentoptions- scheduling optionsarg1- first activity argument- Returns:
- the activity result
- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, R executeA2, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with two activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argument- Returns:
- the activity result
- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, R executeA2, A3, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with three activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argument- Returns:
- the activity result
- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, R executeA2, A3, A4, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with four activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argument- Returns:
- the activity result
- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, R executeA2, A3, A4, A5, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with five activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argument- Returns:
- the activity result
- Throws:
ActivityFailedException- if the activity failed, timed out, or was cancelled
-
execute
default <I,A1, R executeA2, A3, A4, A5, A6, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argumentA6- the type of the sixth activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with six activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argumentarg6- 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 classactivity- unbound method reference with no activity argumentsoptions- 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 typeA1- the type of the first activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with one activity argumentoptions- scheduling optionsarg1- first activity argument- Returns:
- a future that completes when the activity completes
-
executeAsync
default <I,A1, CompletableFuture<Void> executeAsyncA2> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with two activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argument- Returns:
- a future that completes when the activity completes
-
executeAsync
default <I,A1, CompletableFuture<Void> executeAsyncA2, A3> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with three activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argument- Returns:
- a future that completes when the activity completes
-
executeAsync
default <I,A1, CompletableFuture<Void> executeAsyncA2, A3, A4> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with four activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argument- Returns:
- a future that completes when the activity completes
-
executeAsync
default <I,A1, CompletableFuture<Void> executeAsyncA2, A3, A4, A5> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with five activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argument- Returns:
- a future that completes when the activity completes
-
executeAsync
default <I,A1, CompletableFuture<Void> executeAsyncA2, A3, A4, A5, A6> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argumentA6- the type of the sixth activity argument- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with six activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argumentarg6- 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 typeR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with no activity argumentsoptions- scheduling options- Returns:
- a future that resolves to the activity result
-
executeAsync
default <I,A1, CompletableFuture<R> executeAsyncR> (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 typeA1- the type of the first activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with one activity argumentoptions- scheduling optionsarg1- first activity argument- Returns:
- a future that resolves to the activity result
-
executeAsync
default <I,A1, CompletableFuture<R> executeAsyncA2, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with two activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argument- Returns:
- a future that resolves to the activity result
-
executeAsync
default <I,A1, CompletableFuture<R> executeAsyncA2, A3, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with three activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argument- Returns:
- a future that resolves to the activity result
-
executeAsync
default <I,A1, CompletableFuture<R> executeAsyncA2, A3, A4, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with four activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argument- Returns:
- a future that resolves to the activity result
-
executeAsync
default <I,A1, CompletableFuture<R> executeAsyncA2, A3, A4, A5, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with five activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argument- Returns:
- a future that resolves to the activity result
-
executeAsync
default <I,A1, CompletableFuture<R> executeAsyncA2, A3, A4, A5, A6, R> (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 typeA1- the type of the first activity argumentA2- the type of the second activity argumentA3- the type of the third activity argumentA4- the type of the fourth activity argumentA5- the type of the fifth activity argumentA6- the type of the sixth activity argumentR- the activity result type- Parameters:
activityInterface- the activity interface classactivity- unbound method reference with six activity argumentsoptions- scheduling optionsarg1- first activity argumentarg2- second activity argumentarg3- third activity argumentarg4- fourth activity argumentarg5- fifth activity argumentarg6- 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 nameoptions- 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 nameresultClass- expected result typeoptions- scheduling optionsargs- activity arguments- Returns:
- a typed handle whose
ActivityHandle.getResult()returnsR - 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 nameresultClass- expected result classresultType- generic type for deserialisation (e.g. fromTypeToken.getType())options- scheduling optionsargs- activity arguments- Returns:
- a typed handle
- Throws:
ActivityAlreadyStartedException- if an activity with the same ID is already running
-
execute
Starts a standalone activity and blocks until it completes, discarding the result.- Parameters:
activityType- the registered activity type nameoptions- scheduling optionsargs- 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 nameresultClass- expected result typeoptions- scheduling optionsargs- 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 nameresultClass- expected result classresultType- generic type for deserialisationoptions- scheduling optionsargs- 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 nameoptions- scheduling optionsargs- 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 nameresultClass- expected result typeoptions- scheduling optionsargs- 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 nameresultClass- expected result classresultType- generic type for deserialisationoptions- scheduling optionsargs- activity arguments- Returns:
- a future that resolves to the activity result
-
getHandle
Returns an untyped handle to an existing standalone activity execution.- Parameters:
activityId- the user-assigned activity IDactivityRunId- the server-assigned run ID, ornullto 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 IDactivityRunId- the server-assigned run ID, ornullto target any runresultClass- 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 IDactivityRunId- the server-assigned run ID, ornullto target any runresultClass- expected result classresultType- generic type for deserialisation; may benull- Returns:
- a typed handle
-
listExecutions
Returns a stream of activity executions matching the given query.- Parameters:
query- Temporal visibility query string- Returns:
- stream of matching activity executions
-
countExecutions
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 newActivityCompletionClientfor completing activities asynchronously using a task token or activity ID.- Returns:
- a new completion client
-