Class NexusStartActivityHelper
java.lang.Object
io.temporal.internal.nexus.NexusStartActivityHelper
Shared helper for starting an activity from a Nexus operation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic NexusStartActivityResponsestartActivityAndAttachLinks(io.nexusrpc.handler.OperationContext ctx, io.nexusrpc.handler.OperationStartDetails details, String activityType, List<Object> args, StartActivityOptions options, Header header, Function<NexusStartActivityRequest, NexusStartActivityResponse> invoker) Starts an activity via the provided invoker function and returns the response.
-
Method Details
-
startActivityAndAttachLinks
public static NexusStartActivityResponse startActivityAndAttachLinks(io.nexusrpc.handler.OperationContext ctx, io.nexusrpc.handler.OperationStartDetails details, String activityType, List<Object> args, StartActivityOptions options, Header header, Function<NexusStartActivityRequest, NexusStartActivityResponse> invoker) Starts an activity via the provided invoker function and returns the response. The root activity invoker records the link fromStartActivityExecutionResponse; the Nexus task handler attaches that link to the operation response.- Parameters:
ctx- the operation contextdetails- the operation start details containing requestId, callback, linksactivityType- the activity type nameargs- the activity argumentsoptions- the activity scheduling options; the task queue defaults to the current worker's task queueheader- the propagated headerinvoker- function that starts the activity given aNexusStartActivityRequest- Returns:
- the
NexusStartActivityResponsecontaining the activity ID and operation token
-