Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.temporal.nexus.Nexus;
import io.temporal.nexus.WorkflowRunOperation;
import io.temporal.samples.nexus.service.NexusService;
import java.util.Locale;

// To create a service implementation, annotate the class with @ServiceImpl and provide the
// interface that the service implements. The service implementation class should have methods that
Expand Down Expand Up @@ -40,14 +41,18 @@ public OperationHandler<NexusService.HelloInput, NexusService.HelloOutput> hello
HelloHandlerWorkflow.class,
// Workflow IDs should typically be business meaningful IDs and are used to
// dedupe workflow starts.
// For this example, we're using the request ID allocated by Temporal when
// the
// caller workflow schedules
// the operation, this ID is guaranteed to be stable across retries of this
// operation.
// For this example, tie the workflow ID to the customer being greeted so
// that
// repeated operations for the same customer run on the same workflow.
//
// Task queue defaults to the task queue this operation is handled on.
WorkflowOptions.newBuilder().setWorkflowId(details.getRequestId()).build())
WorkflowOptions.newBuilder()
.setWorkflowId(
String.format(
"hello-%s-%s",
input.getName(),
input.getLanguage().name().toLowerCase(Locale.ROOT)))
.build())
::hello);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.temporal.nexus.WorkflowRunOperation;
import io.temporal.samples.nexus.handler.HelloHandlerWorkflow;
import io.temporal.samples.nexus.service.NexusService;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
Expand Down Expand Up @@ -52,14 +53,18 @@ public OperationHandler<NexusService.HelloInput, NexusService.HelloOutput> hello
HelloHandlerWorkflow.class,
// Workflow IDs should typically be business meaningful IDs and are used to
// dedupe workflow starts.
// For this example, we're using the request ID allocated by Temporal when
// the
// caller workflow schedules
// the operation, this ID is guaranteed to be stable across retries of this
// operation.
// For this example, tie the workflow ID to the customer being greeted so
// that
// repeated operations for the same customer run on the same workflow.
//
// Task queue defaults to the task queue this operation is handled on.
WorkflowOptions.newBuilder().setWorkflowId(details.getRequestId()).build())
WorkflowOptions.newBuilder()
.setWorkflowId(
String.format(
"hello-%s-%s",
input.getName(),
input.getLanguage().name().toLowerCase(Locale.ROOT)))
.build())
::hello);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.temporal.nexus.WorkflowHandle;
import io.temporal.nexus.WorkflowRunOperation;
import io.temporal.samples.nexus.service.NexusService;
import java.util.Locale;

// To create a service implementation, annotate the class with @ServiceImpl and provide the
// interface that the service implements. The service implementation class should have methods that
Expand Down Expand Up @@ -41,17 +42,18 @@ public OperationHandler<NexusService.HelloInput, NexusService.HelloOutput> hello
// Workflow IDs should typically be business meaningful IDs and are used
// to
// dedupe workflow starts.
// For this example, we're using the request ID allocated by Temporal
// when
// the
// caller workflow schedules
// the operation, this ID is guaranteed to be stable across retries of
// this
// operation.
// For this example, tie the workflow ID to the customer being greeted
// so
// that
// repeated operations for the same customer run on the same workflow.
//
// Task queue defaults to the task queue this operation is handled on.
WorkflowOptions.newBuilder()
.setWorkflowId(details.getRequestId())
.setWorkflowId(
String.format(
"hello-%s-%s",
input.getName(),
input.getLanguage().name().toLowerCase(Locale.ROOT)))
.build())
::hello,
input.getName(),
Expand Down
Loading