Skip to content

Commit 4706130

Browse files
Fix link wiring
1 parent 994e577 commit 4706130

2 files changed

Lines changed: 10 additions & 16 deletions

File tree

temporal-sdk/src/main/java/io/temporal/internal/client/RootActivityClientInvoker.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ public StartActivityOutput startActivity(StartActivityInput input) {
157157
throw e;
158158
}
159159

160+
if (nexusOperationMetadata != null && response.hasLink()) {
161+
nexusContext.addResponseLink(response.getLink());
162+
}
163+
160164
String runId = response.getRunId().isEmpty() ? null : response.getRunId();
161165
return new StartActivityOutput(options.getId(), runId);
162166
}

temporal-sdk/src/main/java/io/temporal/internal/nexus/NexusStartActivityHelper.java

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,16 @@
1010
import java.util.List;
1111
import java.util.function.Function;
1212

13-
/**
14-
* Shared helper for starting an activity from a Nexus operation and (in future) attaching links to
15-
* the operation context. Mirrors {@link NexusStartWorkflowHelper} for activities.
16-
*/
13+
/** Shared helper for starting an activity from a Nexus operation. */
1714
@Experimental
1815
public class NexusStartActivityHelper {
1916

2017
/**
21-
* Starts an activity via the provided invoker function and returns the response.
18+
* Starts an activity via the provided invoker function and returns the response. The root
19+
* activity invoker records the link from {@code StartActivityExecutionResponse}; the Nexus task
20+
* handler attaches that link to the operation response.
2221
*
23-
* <p>The link-attachment block is intentionally a no-op in this revision; see the TODO inside.
24-
*
25-
* @param ctx the operation context (link attachment is deferred — see TODO)
22+
* @param ctx the operation context
2623
* @param details the operation start details containing requestId, callback, links
2724
* @param activityType the activity type name
2825
* @param args the activity arguments
@@ -53,14 +50,7 @@ public static NexusStartActivityResponse startActivityAndAttachLinks(
5350
options,
5451
header);
5552

56-
NexusStartActivityResponse response = invoker.apply(nexusRequest);
57-
58-
// TODO: Attach activity-event link when server-side activity link support is available.
59-
// No StartActivityResponseLink analog exists and there is no verified activity-event link path
60-
// in LinkConverter. Do NOT copy the synthetic workflow-event link fabrication from
61-
// NexusStartWorkflowHelper; Nexus operations function correctly without diagnostic links.
62-
63-
return response;
53+
return invoker.apply(nexusRequest);
6454
}
6555

6656
private NexusStartActivityHelper() {}

0 commit comments

Comments
 (0)