Skip to content

Commit 5d4eb88

Browse files
Switch to CancelWorkflowRunInput
1 parent ab81e28 commit 5d4eb88

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

temporal-sdk/src/main/java/io/temporal/nexus/TemporalOperationHandler.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public final void cancel(OperationContext ctx, OperationCancelDetails details) {
102102

103103
TemporalOperationCancelContext cancelContext = new TemporalOperationCancelContext(ctx, details);
104104
if (token.getType() == OperationTokenType.WORKFLOW_RUN) {
105-
cancelWorkflowRun(cancelContext, token.getWorkflowId());
105+
cancelWorkflowRun(cancelContext, new CancelWorkflowRunInput(token.getWorkflowId()));
106106
} else {
107107
throw new HandlerException(
108108
HandlerException.ErrorType.BAD_REQUEST,
@@ -117,10 +117,11 @@ public final void cancel(OperationContext ctx, OperationCancelDetails details) {
117117
* <p>Default behavior: cancels the underlying workflow.
118118
*
119119
* @param context the cancel context
120-
* @param workflowId the workflow ID extracted from the operation token
120+
* @param input describes the workflow run to cancel
121121
*/
122-
protected void cancelWorkflowRun(TemporalOperationCancelContext context, String workflowId) {
122+
protected void cancelWorkflowRun(
123+
TemporalOperationCancelContext context, CancelWorkflowRunInput input) {
123124
WorkflowClient client = CurrentNexusOperationContext.get().getWorkflowClient();
124-
client.newUntypedWorkflowStub(workflowId).cancel();
125+
client.newUntypedWorkflowStub(input.getWorkflowId()).cancel();
125126
}
126127
}

0 commit comments

Comments
 (0)