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 @@ -77,6 +77,13 @@ public int execute(int count, String continueAsNewTaskQueue) {
assertEquals(5, Workflow.getInfo().getRetryOptions().getMaximumAttempts());
assertEquals("foo1", Workflow.getTypedSearchAttributes().get(CUSTOM_KEYWORD_SA));
}
// The memo is set on every continue-as-new below, so every run after the
// first one should observe it once the test server propagates it.
if (count <= INITIAL_COUNT - 2) {
assertEquals("MyValue", Workflow.getMemo("myKey", String.class));
} else {
Assert.assertNull(Workflow.getMemo("myKey", String.class));
}
if (count == 0) {
assertEquals(continueAsNewTaskQueue, taskQueue);
return 111;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,9 @@ private static void continueAsNewWorkflow(
if (d.hasSearchAttributes()) {
a.setSearchAttributes(d.getSearchAttributes());
}
if (d.hasMemo()) {
a.setMemo(d.getMemo());
}
a.setNewExecutionRunId(UUID.randomUUID().toString());
HistoryEvent event =
HistoryEvent.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,9 @@ public String continueAsNew(
if (ea.hasSearchAttributes()) {
startRequestBuilder.setSearchAttributes(ea.getSearchAttributes());
}
if (ea.hasMemo()) {
startRequestBuilder.setMemo(ea.getMemo());
}
StartWorkflowExecutionRequest startRequest = startRequestBuilder.build();
lock.lock();
Optional<Failure> lastFail =
Expand Down