Skip to content

Commit 943fe2e

Browse files
Revert removing "Control" field (#2634)
1 parent b6b4290 commit 943fe2e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

temporal-test-server/src/main/java/io/temporal/internal/testservice/StateMachines.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,9 +1125,11 @@ private static void initiateChildWorkflow(
11251125
ChildWorkflowData data,
11261126
StartChildWorkflowExecutionCommandAttributes d,
11271127
long workflowTaskCompletedEventId) {
1128+
@SuppressWarnings("deprecation") // Control is still used by some SDKs
11281129
StartChildWorkflowExecutionInitiatedEventAttributes.Builder a =
11291130
StartChildWorkflowExecutionInitiatedEventAttributes.newBuilder()
11301131
.setInput(d.getInput())
1132+
.setControl(d.getControl())
11311133
.setWorkflowTaskCompletedEventId(workflowTaskCompletedEventId)
11321134
.setNamespace(d.getNamespace().isEmpty() ? ctx.getNamespace() : d.getNamespace())
11331135
.setWorkflowExecutionTimeout(d.getWorkflowExecutionTimeout())
@@ -2385,9 +2387,11 @@ private static void initiateExternalSignal(
23852387
SignalExternalData data,
23862388
SignalExternalWorkflowExecutionCommandAttributes d,
23872389
long workflowTaskCompletedEventId) {
2390+
@SuppressWarnings("deprecation") // Control is still used by some SDKs
23882391
SignalExternalWorkflowExecutionInitiatedEventAttributes.Builder a =
23892392
SignalExternalWorkflowExecutionInitiatedEventAttributes.newBuilder()
23902393
.setWorkflowTaskCompletedEventId(workflowTaskCompletedEventId)
2394+
.setControl(d.getControl())
23912395
.setInput(d.getInput())
23922396
.setNamespace(d.getNamespace())
23932397
.setChildWorkflowOnly(d.getChildWorkflowOnly())
@@ -2413,9 +2417,11 @@ private static void failExternalSignal(
24132417
SignalExternalWorkflowExecutionFailedCause cause,
24142418
long notUsed) {
24152419
SignalExternalWorkflowExecutionInitiatedEventAttributes initiatedEvent = data.initiatedEvent;
2420+
@SuppressWarnings("deprecation") // Control is still used by some SDKs
24162421
SignalExternalWorkflowExecutionFailedEventAttributes.Builder a =
24172422
SignalExternalWorkflowExecutionFailedEventAttributes.newBuilder()
24182423
.setInitiatedEventId(data.initiatedEventId)
2424+
.setControl(initiatedEvent.getControl())
24192425
.setWorkflowExecution(initiatedEvent.getWorkflowExecution())
24202426
.setCause(cause)
24212427
.setNamespace(initiatedEvent.getNamespace());
@@ -2432,9 +2438,11 @@ private static void completeExternalSignal(
24322438
SignalExternalWorkflowExecutionInitiatedEventAttributes initiatedEvent = data.initiatedEvent;
24332439
WorkflowExecution signaledExecution =
24342440
initiatedEvent.getWorkflowExecution().toBuilder().setRunId(runId).build();
2441+
@SuppressWarnings("deprecation") // Control is still used by some SDKs
24352442
ExternalWorkflowExecutionSignaledEventAttributes.Builder a =
24362443
ExternalWorkflowExecutionSignaledEventAttributes.newBuilder()
24372444
.setInitiatedEventId(data.initiatedEventId)
2445+
.setControl(initiatedEvent.getControl())
24382446
.setWorkflowExecution(signaledExecution)
24392447
.setNamespace(initiatedEvent.getNamespace());
24402448
HistoryEvent event =
@@ -2450,9 +2458,11 @@ private static void initiateExternalCancellation(
24502458
CancelExternalData data,
24512459
RequestCancelExternalWorkflowExecutionCommandAttributes d,
24522460
long workflowTaskCompletedEventId) {
2461+
@SuppressWarnings("deprecation") // Control is still used by some SDKs
24532462
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes.Builder a =
24542463
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes.newBuilder()
24552464
.setWorkflowTaskCompletedEventId(workflowTaskCompletedEventId)
2465+
.setControl(d.getControl())
24562466
.setNamespace(d.getNamespace())
24572467
.setChildWorkflowOnly(d.getChildWorkflowOnly())
24582468
.setWorkflowExecution(
@@ -2502,10 +2512,12 @@ private static void failExternalCancellation(
25022512
long notUsed) {
25032513
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes initiatedEvent =
25042514
data.initiatedEvent;
2515+
@SuppressWarnings("deprecation") // Control is still used by some SDKs
25052516
RequestCancelExternalWorkflowExecutionFailedEventAttributes.Builder a =
25062517
RequestCancelExternalWorkflowExecutionFailedEventAttributes.newBuilder()
25072518
.setInitiatedEventId(data.initiatedEventId)
25082519
.setWorkflowExecution(initiatedEvent.getWorkflowExecution())
2520+
.setControl(initiatedEvent.getControl())
25092521
.setCause(cause)
25102522
.setNamespace(initiatedEvent.getNamespace());
25112523
HistoryEvent event =

temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,12 +1418,14 @@ public void signalWithStartWorkflowExecution(
14181418
}
14191419
ExecutionId executionId = new ExecutionId(r.getNamespace(), r.getWorkflowId(), null);
14201420
TestWorkflowMutableState mutableState = getMutableState(executionId, false);
1421+
@SuppressWarnings("deprecation") // Control is still used by some SDKs
14211422
SignalWorkflowExecutionRequest signalRequest =
14221423
SignalWorkflowExecutionRequest.newBuilder()
14231424
.setInput(r.getSignalInput())
14241425
.setSignalName(r.getSignalName())
14251426
.setWorkflowExecution(executionId.getExecution())
14261427
.setRequestId(r.getRequestId())
1428+
.setControl(r.getControl())
14271429
.setNamespace(r.getNamespace())
14281430
.setIdentity(r.getIdentity())
14291431
.addAllLinks(r.getLinksList())

0 commit comments

Comments
 (0)