From f80cfb3723f47fec212a420b241a9e0155117b55 Mon Sep 17 00:00:00 2001 From: Quinn Klassen Date: Wed, 30 Apr 2025 09:39:41 -0700 Subject: [PATCH] Call out WorkflowRunOperation.fromWorkflowHandler --- .../io/temporal/samples/nexus/handler/NexusServiceImpl.java | 5 ++++- .../nexuscontextpropagation/handler/NexusServiceImpl.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/io/temporal/samples/nexus/handler/NexusServiceImpl.java b/core/src/main/java/io/temporal/samples/nexus/handler/NexusServiceImpl.java index d7fda2fd9..e4a58ae95 100644 --- a/core/src/main/java/io/temporal/samples/nexus/handler/NexusServiceImpl.java +++ b/core/src/main/java/io/temporal/samples/nexus/handler/NexusServiceImpl.java @@ -47,7 +47,10 @@ public OperationHandler echo() @OperationImpl public OperationHandler hello() { // Use the WorkflowRunOperation.fromWorkflowMethod constructor, which is the easiest - // way to expose a workflow as an operation. + // way to expose a workflow as an operation. To expose a workflow with a different input + // parameters then the operation or from an untyped stub, use the + // WorkflowRunOperation.fromWorkflowHandler constructor and the appropriate constructor method + // on WorkflowHandle. return WorkflowRunOperation.fromWorkflowMethod( (ctx, details, input) -> Nexus.getOperationContext() diff --git a/core/src/main/java/io/temporal/samples/nexuscontextpropagation/handler/NexusServiceImpl.java b/core/src/main/java/io/temporal/samples/nexuscontextpropagation/handler/NexusServiceImpl.java index cad37b9ed..b4ac16493 100644 --- a/core/src/main/java/io/temporal/samples/nexuscontextpropagation/handler/NexusServiceImpl.java +++ b/core/src/main/java/io/temporal/samples/nexuscontextpropagation/handler/NexusServiceImpl.java @@ -59,7 +59,10 @@ public OperationHandler echo() @OperationImpl public OperationHandler hello() { // Use the WorkflowRunOperation.fromWorkflowMethod constructor, which is the easiest - // way to expose a workflow as an operation. + // way to expose a workflow as an operation. To expose a workflow with a different input + // parameters then the operation or from an untyped stub, use the + // WorkflowRunOperation.fromWorkflowHandler constructor and the appropriate constructor method + // on WorkflowHandle. return WorkflowRunOperation.fromWorkflowMethod( (ctx, details, input) -> Nexus.getOperationContext()