File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
temporal-sdk/src/main/java/io/temporal/internal/replay Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -119,18 +119,16 @@ private Result handleWorkflowTaskWithQuery(
119
119
Result result ;
120
120
121
121
if (directQuery ) {
122
- // Direct query happens when there is no reason (events) to produce a real persisted
123
- // workflow task.
124
- // But Server needs to notify the workflow about the query and get back the query result.
125
- // Server creates a fake non-persisted a PollWorkflowTaskResponse with just the query.
126
- // This WFT has no new events in the history to process
127
- // and the worker response on such a WFT can't contain any new commands either.
122
+ // A direct query is when the server needs to notify the workflow about queries (and get back the query
123
+ // results), but there are no new events in history. In this situation the server creates a
124
+ // PollWorkflowTaskResponse (i.e. a WFT) with the queries but without new events in the history. The worker
125
+ // response to such a WFT may not contain any new commands.
128
126
QueryResult queryResult =
129
127
workflowRunTaskHandler .handleDirectQueryWorkflowTask (workflowTask , historyIterator );
130
128
finalCommand = queryResult .isWorkflowMethodCompleted ();
131
129
result = createDirectQueryResult (workflowTask , queryResult , null );
132
130
} else {
133
- // main code path, handle workflow task that can have an embedded query
131
+ // Main code path; handle workflow task (with events, and perhaps also queries).
134
132
WorkflowTaskResult wftResult =
135
133
workflowRunTaskHandler .handleWorkflowTask (workflowTask , historyIterator );
136
134
finalCommand = wftResult .isFinalCommand ();
You can’t perform that action at this time.
0 commit comments