@@ -106,7 +106,7 @@ type (
106
106
env * testWorkflowEnvironmentImpl
107
107
seq int64
108
108
params executeNexusOperationParams
109
- operationID string
109
+ operationToken string
110
110
cancelRequested bool
111
111
started bool
112
112
done bool
@@ -2504,7 +2504,7 @@ func (env *testWorkflowEnvironmentImpl) ExecuteNexusOperation(
2504
2504
}, true )
2505
2505
case * nexuspb.StartOperationResponse_AsyncSuccess :
2506
2506
env .postCallback (func () {
2507
- opID = v .AsyncSuccess .GetOperationId ()
2507
+ opID = v .AsyncSuccess .GetOperationToken ()
2508
2508
handle .startedCallback (opID , nil )
2509
2509
if handle .cancelRequested {
2510
2510
handle .cancel ()
@@ -2551,7 +2551,7 @@ func (env *testWorkflowEnvironmentImpl) RequestCancelNexusOperation(seq int64) {
2551
2551
func (env * testWorkflowEnvironmentImpl ) RegisterNexusAsyncOperationCompletion (
2552
2552
service string ,
2553
2553
operation string ,
2554
- operationID string ,
2554
+ token string ,
2555
2555
result any ,
2556
2556
err error ,
2557
2557
delay time.Duration ,
@@ -2586,7 +2586,7 @@ func (env *testWorkflowEnvironmentImpl) RegisterNexusAsyncOperationCompletion(
2586
2586
env .setNexusAsyncOperationCompletionHandle (
2587
2587
service ,
2588
2588
operation ,
2589
- operationID ,
2589
+ token ,
2590
2590
& testNexusAsyncOperationHandle {
2591
2591
result : data ,
2592
2592
err : err ,
@@ -2599,28 +2599,28 @@ func (env *testWorkflowEnvironmentImpl) RegisterNexusAsyncOperationCompletion(
2599
2599
func (env * testWorkflowEnvironmentImpl ) getNexusAsyncOperationCompletionHandle (
2600
2600
service string ,
2601
2601
operation string ,
2602
- operationID string ,
2602
+ token string ,
2603
2603
) * testNexusAsyncOperationHandle {
2604
- uniqueOpID := env .makeUniqueNexusOperationID (service , operation , operationID )
2604
+ uniqueOpID := env .makeUniqueNexusOperationToken (service , operation , token )
2605
2605
return env .nexusAsyncOpHandle [uniqueOpID ]
2606
2606
}
2607
2607
2608
2608
func (env * testWorkflowEnvironmentImpl ) setNexusAsyncOperationCompletionHandle (
2609
2609
service string ,
2610
2610
operation string ,
2611
- operationID string ,
2611
+ token string ,
2612
2612
handle * testNexusAsyncOperationHandle ,
2613
2613
) {
2614
- uniqueOpID := env .makeUniqueNexusOperationID (service , operation , operationID )
2614
+ uniqueOpID := env .makeUniqueNexusOperationToken (service , operation , token )
2615
2615
env .nexusAsyncOpHandle [uniqueOpID ] = handle
2616
2616
}
2617
2617
2618
2618
func (env * testWorkflowEnvironmentImpl ) deleteNexusAsyncOperationCompletionHandle (
2619
2619
service string ,
2620
2620
operation string ,
2621
- operationID string ,
2621
+ token string ,
2622
2622
) {
2623
- uniqueOpID := env .makeUniqueNexusOperationID (service , operation , operationID )
2623
+ uniqueOpID := env .makeUniqueNexusOperationToken (service , operation , token )
2624
2624
delete (env .nexusAsyncOpHandle , uniqueOpID )
2625
2625
}
2626
2626
@@ -2630,21 +2630,21 @@ func (env *testWorkflowEnvironmentImpl) scheduleNexusAsyncOperationCompletion(
2630
2630
completionHandle := env .getNexusAsyncOperationCompletionHandle (
2631
2631
handle .params .client .Service (),
2632
2632
handle .params .operation ,
2633
- handle .operationID ,
2633
+ handle .operationToken ,
2634
2634
)
2635
2635
if completionHandle == nil {
2636
2636
return
2637
2637
}
2638
2638
env .deleteNexusAsyncOperationCompletionHandle (
2639
2639
handle .params .client .Service (),
2640
2640
handle .params .operation ,
2641
- handle .operationID ,
2641
+ handle .operationToken ,
2642
2642
)
2643
2643
var nexusErr error
2644
2644
if completionHandle .err != nil {
2645
2645
nexusErr = env .failureConverter .FailureToError (nexusOperationFailure (
2646
2646
handle .params ,
2647
- handle .operationID ,
2647
+ handle .operationToken ,
2648
2648
& failurepb.Failure {
2649
2649
Message : completionHandle .err .Error (),
2650
2650
FailureInfo : & failurepb.Failure_ApplicationFailureInfo {
@@ -2670,7 +2670,7 @@ func (env *testWorkflowEnvironmentImpl) resolveNexusOperation(seq int64, result
2670
2670
}
2671
2671
if err != nil {
2672
2672
failure := env .failureConverter .ErrorToFailure (err )
2673
- err = env .failureConverter .FailureToError (nexusOperationFailure (handle .params , handle .operationID , failure .GetCause ()))
2673
+ err = env .failureConverter .FailureToError (nexusOperationFailure (handle .params , handle .operationToken , failure .GetCause ()))
2674
2674
handle .completedCallback (nil , err )
2675
2675
} else {
2676
2676
handle .completedCallback (result , nil )
@@ -2696,12 +2696,12 @@ func (env *testWorkflowEnvironmentImpl) deleteNexusOperationHandle(seqID int64)
2696
2696
delete (env .runningNexusOperations , seqID )
2697
2697
}
2698
2698
2699
- func (env * testWorkflowEnvironmentImpl ) makeUniqueNexusOperationID (
2699
+ func (env * testWorkflowEnvironmentImpl ) makeUniqueNexusOperationToken (
2700
2700
service string ,
2701
2701
operation string ,
2702
- operationID string ,
2702
+ token string ,
2703
2703
) string {
2704
- return fmt .Sprintf ("%s_%s_%s" , service , operation , operationID )
2704
+ return fmt .Sprintf ("%s_%s_%s" , service , operation , token )
2705
2705
}
2706
2706
2707
2707
func (env * testWorkflowEnvironmentImpl ) SideEffect (f func () (* commonpb.Payloads , error ), callback ResultHandler ) {
@@ -3202,9 +3202,9 @@ func (h *testNexusOperationHandle) newCancelTask() *workflowservice.PollNexusTas
3202
3202
Header : h .params .nexusHeader ,
3203
3203
Variant : & nexuspb.Request_CancelOperation {
3204
3204
CancelOperation : & nexuspb.CancelOperationRequest {
3205
- Service : h .params .client .Service (),
3206
- Operation : h .params .operation ,
3207
- OperationId : h .operationID ,
3205
+ Service : h .params .client .Service (),
3206
+ Operation : h .params .operation ,
3207
+ OperationToken : h .operationToken ,
3208
3208
},
3209
3209
},
3210
3210
},
@@ -3241,7 +3241,7 @@ func (h *testNexusOperationHandle) startedCallback(opID string, e error) {
3241
3241
// Ignore duplciate starts.
3242
3242
return
3243
3243
}
3244
- h .operationID = opID
3244
+ h .operationToken = opID
3245
3245
h .started = true
3246
3246
h .onStarted (opID , e )
3247
3247
h .env .runningCount --
@@ -3251,7 +3251,7 @@ func (h *testNexusOperationHandle) cancel() {
3251
3251
if h .done {
3252
3252
return
3253
3253
}
3254
- if h .started && h .operationID == "" {
3254
+ if h .started && h .operationToken == "" {
3255
3255
panic (fmt .Errorf ("incomplete operation has no operation ID: (%s, %s, %s)" ,
3256
3256
h .params .client .Endpoint (), h .params .client .Service (), h .params .operation ))
3257
3257
}
@@ -3445,34 +3445,34 @@ func (r *testNexusHandler) CancelOperation(
3445
3445
ctx context.Context ,
3446
3446
service string ,
3447
3447
operation string ,
3448
- operationID string ,
3448
+ token string ,
3449
3449
options nexus.CancelOperationOptions ,
3450
3450
) error {
3451
3451
if r .opHandle .isMocked {
3452
3452
// if the operation was mocked, then there's no workflow running
3453
3453
return nil
3454
3454
}
3455
- return r .handler .CancelOperation (ctx , service , operation , operationID , options )
3455
+ return r .handler .CancelOperation (ctx , service , operation , token , options )
3456
3456
}
3457
3457
3458
3458
func (r * testNexusHandler ) GetOperationInfo (
3459
3459
ctx context.Context ,
3460
3460
service string ,
3461
3461
operation string ,
3462
- operationID string ,
3462
+ token string ,
3463
3463
options nexus.GetOperationInfoOptions ,
3464
3464
) (* nexus.OperationInfo , error ) {
3465
- return r .handler .GetOperationInfo (ctx , service , operation , operationID , options )
3465
+ return r .handler .GetOperationInfo (ctx , service , operation , token , options )
3466
3466
}
3467
3467
3468
3468
func (r * testNexusHandler ) GetOperationResult (
3469
3469
ctx context.Context ,
3470
3470
service string ,
3471
3471
operation string ,
3472
- operationID string ,
3472
+ token string ,
3473
3473
options nexus.GetOperationResultOptions ,
3474
3474
) (any , error ) {
3475
- return r .handler .GetOperationResult (ctx , service , operation , operationID , options )
3475
+ return r .handler .GetOperationResult (ctx , service , operation , token , options )
3476
3476
}
3477
3477
3478
3478
func (env * testWorkflowEnvironmentImpl ) registerNexusOperationReference (
0 commit comments