Skip to content

Commit 5ca7674

Browse files
committed
Updating a readme
1 parent 050f0c4 commit 5ca7674

File tree

1 file changed

+5
-4
lines changed
  • core/src/main/java/io/temporal/samples/nexus_messaging/callerpattern

1 file changed

+5
-4
lines changed

core/src/main/java/io/temporal/samples/nexus_messaging/callerpattern/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
## Entity pattern
22

3-
The handler worker starts a single `GreetingWorkflow` with a fixed workflow ID.
4-
`NexusGreetingServiceImpl` holds that ID and routes every Nexus operation to it. The caller's
5-
inputs contain only business data — no workflow IDs.
3+
The handler worker starts a `GreetingWorkflow` for a user ID.
4+
`NexusGreetingServiceImpl` holds that ID and routes every Nexus operation to it.
5+
The caller's input does not have that workflow ID as the caller doesn't know it - but the caller sends in the User ID,
6+
and `NexusGreetingServiceImpl` knows how to get the desired workflow ID from that User ID (see the getWorkflowId call).
67

7-
Refer to the on demand pattern examples and you will see how to expand this example to not just a single fixed workflow ID - the NexusGreetingServiceImpl simply needs to be able to map something from the inputs to a Workflow ID. For example if the workflow ID is a user ID with a prefix, then if the Nexus inputs include a User ID, then Nexus can simple prepend the same string to get the desired workflow ID.
8+
HandlerWorker is using the same getWorkflowId call to generate a workflow ID from a user ID when it launches the workflow.
89

910
The caller workflow:
1011
1. Queries for supported languages (`getLanguages` — backed by a `@QueryMethod`)

0 commit comments

Comments
 (0)