• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

temporalio / sdk-java / #343

31 Oct 2024 06:31PM UTC coverage: 75.148% (-3.6%) from 78.794%
#343

push

github

web-flow
Fix jacoco coverage (#2304)

5139 of 8240 branches covered (62.37%)

Branch coverage included in aggregate %.

22841 of 28993 relevant lines covered (78.78%)

0.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.29
/temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkflowOutboundCallsInterceptor.java
1
/*
2
 * Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved.
3
 *
4
 * Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
 *
6
 * Modifications copyright (C) 2017 Uber Technologies, Inc.
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this material except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 *   http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20

21
package io.temporal.common.interceptors;
22

23
import com.uber.m3.tally.Scope;
24
import io.temporal.activity.ActivityOptions;
25
import io.temporal.activity.LocalActivityOptions;
26
import io.temporal.api.common.v1.WorkflowExecution;
27
import io.temporal.common.Experimental;
28
import io.temporal.common.SearchAttributeUpdate;
29
import io.temporal.workflow.*;
30
import io.temporal.workflow.Functions.Func;
31
import java.lang.reflect.Type;
32
import java.time.Duration;
33
import java.util.*;
34
import java.util.function.BiPredicate;
35
import java.util.function.Supplier;
36
import javax.annotation.Nullable;
37

38
/**
39
 * Can be used to intercept calls from to workflow code into the Temporal APIs.
40
 *
41
 * <p>The calls to the interceptor are executed in the context of a workflow and must follow the
42
 * same rules all the other workflow code follows.
43
 *
44
 * <p>Prefer extending {@link WorkflowOutboundCallsInterceptorBase} and overriding only the methods
45
 * you need instead of implementing this interface directly. {@link
46
 * WorkflowOutboundCallsInterceptorBase} provides correct default implementations to all the methods
47
 * of this interface.
48
 *
49
 * <p>An instance may be created in {@link
50
 * WorkflowInboundCallsInterceptor#init(WorkflowOutboundCallsInterceptor)} and set by passing it
51
 * into {@code init} method of the {@code next} {@link WorkflowInboundCallsInterceptor} The
52
 * implementation must forward all the calls to the outbound interceptor passed as a {@code
53
 * outboundCalls} parameter to the {@code init} call.
54
 *
55
 * @see WorkerInterceptor#interceptWorkflow for the definition of "next" {@link
56
 *     WorkflowInboundCallsInterceptor}.
57
 */
58
@Experimental
59
public interface WorkflowOutboundCallsInterceptor {
60

61
  final class ActivityInput<R> {
62
    private final String activityName;
63
    private final Class<R> resultClass;
64
    private final Type resultType;
65
    private final Object[] args;
66
    private final ActivityOptions options;
67
    private final Header header;
68

69
    public ActivityInput(
70
        String activityName,
71
        Class<R> resultClass,
72
        Type resultType,
73
        Object[] args,
74
        ActivityOptions options,
75
        Header header) {
1✔
76
      this.activityName = activityName;
1✔
77
      this.resultClass = resultClass;
1✔
78
      this.resultType = resultType;
1✔
79
      this.args = args;
1✔
80
      this.options = options;
1✔
81
      this.header = header;
1✔
82
    }
1✔
83

84
    public String getActivityName() {
85
      return activityName;
1✔
86
    }
87

88
    public Class<R> getResultClass() {
89
      return resultClass;
1✔
90
    }
91

92
    public Type getResultType() {
93
      return resultType;
1✔
94
    }
95

96
    public Object[] getArgs() {
97
      return args;
1✔
98
    }
99

100
    public ActivityOptions getOptions() {
101
      return options;
1✔
102
    }
103

104
    public Header getHeader() {
105
      return header;
1✔
106
    }
107
  }
108

109
  final class ActivityOutput<R> {
110
    private final String activityId;
111
    private final Promise<R> result;
112

113
    public ActivityOutput(String activityId, Promise<R> result) {
1✔
114
      this.activityId = activityId;
1✔
115
      this.result = result;
1✔
116
    }
1✔
117

118
    public String getActivityId() {
119
      return activityId;
1✔
120
    }
121

122
    public Promise<R> getResult() {
123
      return result;
1✔
124
    }
125
  }
126

127
  final class LocalActivityInput<R> {
128
    private final String activityName;
129
    private final Class<R> resultClass;
130
    private final Type resultType;
131
    private final Object[] args;
132
    private final LocalActivityOptions options;
133
    private final Header header;
134

135
    public LocalActivityInput(
136
        String activityName,
137
        Class<R> resultClass,
138
        Type resultType,
139
        Object[] args,
140
        LocalActivityOptions options,
141
        Header header) {
1✔
142
      this.activityName = activityName;
1✔
143
      this.resultClass = resultClass;
1✔
144
      this.resultType = resultType;
1✔
145
      this.args = args;
1✔
146
      this.options = options;
1✔
147
      this.header = header;
1✔
148
    }
1✔
149

150
    public String getActivityName() {
151
      return activityName;
1✔
152
    }
153

154
    public Class<R> getResultClass() {
155
      return resultClass;
1✔
156
    }
157

158
    public Type getResultType() {
159
      return resultType;
1✔
160
    }
161

162
    public Object[] getArgs() {
163
      return args;
1✔
164
    }
165

166
    public LocalActivityOptions getOptions() {
167
      return options;
1✔
168
    }
169

170
    public Header getHeader() {
171
      return header;
1✔
172
    }
173
  }
174

175
  final class LocalActivityOutput<R> {
176
    private final Promise<R> result;
177

178
    public LocalActivityOutput(Promise<R> result) {
1✔
179
      this.result = result;
1✔
180
    }
1✔
181

182
    public Promise<R> getResult() {
183
      return result;
1✔
184
    }
185
  }
186

187
  final class ChildWorkflowInput<R> {
188
    private final String workflowId;
189
    private final String workflowType;
190
    private final Class<R> resultClass;
191
    private final Type resultType;
192
    private final Object[] args;
193
    private final ChildWorkflowOptions options;
194
    private final Header header;
195

196
    public ChildWorkflowInput(
197
        String workflowId,
198
        String workflowType,
199
        Class<R> resultClass,
200
        Type resultType,
201
        Object[] args,
202
        ChildWorkflowOptions options,
203
        Header header) {
1✔
204
      this.workflowId = workflowId;
1✔
205
      this.workflowType = workflowType;
1✔
206
      this.resultClass = resultClass;
1✔
207
      this.resultType = resultType;
1✔
208
      this.args = args;
1✔
209
      this.options = options;
1✔
210
      this.header = header;
1✔
211
    }
1✔
212

213
    public String getWorkflowId() {
214
      return workflowId;
1✔
215
    }
216

217
    public String getWorkflowType() {
218
      return workflowType;
1✔
219
    }
220

221
    public Class<R> getResultClass() {
222
      return resultClass;
1✔
223
    }
224

225
    public Type getResultType() {
226
      return resultType;
1✔
227
    }
228

229
    public Object[] getArgs() {
230
      return args;
1✔
231
    }
232

233
    public ChildWorkflowOptions getOptions() {
234
      return options;
1✔
235
    }
236

237
    public Header getHeader() {
238
      return header;
1✔
239
    }
240
  }
241

242
  final class ChildWorkflowOutput<R> {
243

244
    private final Promise<R> result;
245
    private final Promise<WorkflowExecution> workflowExecution;
246

247
    public ChildWorkflowOutput(Promise<R> result, Promise<WorkflowExecution> workflowExecution) {
1✔
248
      this.result = result;
1✔
249
      this.workflowExecution = workflowExecution;
1✔
250
    }
1✔
251

252
    public Promise<R> getResult() {
253
      return result;
1✔
254
    }
255

256
    public Promise<WorkflowExecution> getWorkflowExecution() {
257
      return workflowExecution;
1✔
258
    }
259
  }
260

261
  @Experimental
262
  final class ExecuteNexusOperationInput<R> {
263
    private final String endpoint;
264
    private final String service;
265
    private final String operation;
266
    private final Class<R> resultClass;
267
    private final Type resultType;
268
    private final Object arg;
269
    private final NexusOperationOptions options;
270
    private final Map<String, String> headers;
271

272
    public ExecuteNexusOperationInput(
273
        String endpoint,
274
        String service,
275
        String operation,
276
        Class<R> resultClass,
277
        Type resultType,
278
        Object arg,
279
        NexusOperationOptions options,
280
        Map<String, String> headers) {
1✔
281
      this.endpoint = endpoint;
1✔
282
      this.service = service;
1✔
283
      this.operation = operation;
1✔
284
      this.resultClass = resultClass;
1✔
285
      this.resultType = resultType;
1✔
286
      this.arg = arg;
1✔
287
      this.options = options;
1✔
288
      this.headers = headers;
1✔
289
    }
1✔
290

291
    public String getService() {
292
      return service;
1✔
293
    }
294

295
    public String getOperation() {
296
      return operation;
1✔
297
    }
298

299
    public Object getArg() {
300
      return arg;
1✔
301
    }
302

303
    public Class<R> getResultClass() {
304
      return resultClass;
1✔
305
    }
306

307
    public Type getResultType() {
308
      return resultType;
1✔
309
    }
310

311
    public String getEndpoint() {
312
      return endpoint;
1✔
313
    }
314

315
    public NexusOperationOptions getOptions() {
316
      return options;
1✔
317
    }
318

319
    public Map<String, String> getHeaders() {
320
      return headers;
1✔
321
    }
322
  }
323

324
  @Experimental
325
  final class ExecuteNexusOperationOutput<R> {
326
    private final Promise<R> result;
327
    private final Promise<NexusOperationExecution> operationExecution;
328

329
    public ExecuteNexusOperationOutput(
330
        Promise<R> result, Promise<NexusOperationExecution> operationExecution) {
1✔
331
      this.result = result;
1✔
332
      this.operationExecution = operationExecution;
1✔
333
    }
1✔
334

335
    public Promise<R> getResult() {
336
      return result;
1✔
337
    }
338

339
    public Promise<NexusOperationExecution> getOperationExecution() {
340
      return operationExecution;
1✔
341
    }
342
  }
343

344
  final class SignalExternalInput {
345
    private final WorkflowExecution execution;
346
    private final String signalName;
347
    private final Header header;
348
    private final Object[] args;
349

350
    public SignalExternalInput(
351
        WorkflowExecution execution, String signalName, Header header, Object[] args) {
1✔
352
      this.execution = execution;
1✔
353
      this.signalName = signalName;
1✔
354
      this.header = header;
1✔
355
      this.args = args;
1✔
356
    }
1✔
357

358
    public WorkflowExecution getExecution() {
359
      return execution;
1✔
360
    }
361

362
    public String getSignalName() {
363
      return signalName;
1✔
364
    }
365

366
    public Header getHeader() {
367
      return header;
1✔
368
    }
369

370
    public Object[] getArgs() {
371
      return args;
1✔
372
    }
373
  }
374

375
  final class SignalExternalOutput {
376
    private final Promise<Void> result;
377

378
    public SignalExternalOutput(Promise<Void> result) {
1✔
379
      this.result = result;
1✔
380
    }
1✔
381

382
    public Promise<Void> getResult() {
383
      return result;
1✔
384
    }
385
  }
386

387
  final class CancelWorkflowInput {
388
    private final WorkflowExecution execution;
389

390
    public CancelWorkflowInput(WorkflowExecution execution) {
×
391
      this.execution = execution;
×
392
    }
×
393

394
    public WorkflowExecution getExecution() {
395
      return execution;
×
396
    }
397
  }
398

399
  final class CancelWorkflowOutput {
400
    private final Promise<Void> result;
401

402
    public CancelWorkflowOutput(Promise<Void> result) {
×
403
      this.result = result;
×
404
    }
×
405

406
    public Promise<Void> getResult() {
407
      return result;
×
408
    }
409
  }
410

411
  final class ContinueAsNewInput {
412
    private final @Nullable String workflowType;
413
    private final @Nullable ContinueAsNewOptions options;
414
    private final Object[] args;
415
    private final Header header;
416

417
    public ContinueAsNewInput(
418
        @Nullable String workflowType,
419
        @Nullable ContinueAsNewOptions options,
420
        Object[] args,
421
        Header header) {
1✔
422
      this.workflowType = workflowType;
1✔
423
      this.options = options;
1✔
424
      this.args = args;
1✔
425
      this.header = header;
1✔
426
    }
1✔
427

428
    /**
429
     * @return workflowType for the continue-as-new workflow run. null if continue-as-new should
430
     *     inherit the type of the original workflow run.
431
     */
432
    public @Nullable String getWorkflowType() {
433
      return workflowType;
1✔
434
    }
435

436
    /**
437
     * @return options for the continue-as-new workflow run. Can be null, in that case the values
438
     *     will be taken from the original workflow run.
439
     */
440
    public @Nullable ContinueAsNewOptions getOptions() {
441
      return options;
1✔
442
    }
443

444
    public Object[] getArgs() {
445
      return args;
1✔
446
    }
447

448
    public Header getHeader() {
449
      return header;
1✔
450
    }
451
  }
452

453
  final class SignalRegistrationRequest {
454
    private final String signalType;
455
    private final String description;
456
    private final HandlerUnfinishedPolicy unfinishedPolicy;
457
    private final Class<?>[] argTypes;
458
    private final Type[] genericArgTypes;
459
    private final Functions.Proc1<Object[]> callback;
460

461
    // Kept for backward compatibility
462
    public SignalRegistrationRequest(
463
        String signalType,
464
        Class<?>[] argTypes,
465
        Type[] genericArgTypes,
466
        Functions.Proc1<Object[]> callback) {
×
467
      this.signalType = signalType;
×
468
      this.description = "";
×
469
      this.unfinishedPolicy = HandlerUnfinishedPolicy.WARN_AND_ABANDON;
×
470
      this.argTypes = argTypes;
×
471
      this.genericArgTypes = genericArgTypes;
×
472
      this.callback = callback;
×
473
    }
×
474

475
    // Kept for backward compatibility
476
    public SignalRegistrationRequest(
477
        String signalType,
478
        HandlerUnfinishedPolicy unfinishedPolicy,
479
        Class<?>[] argTypes,
480
        Type[] genericArgTypes,
481
        Functions.Proc1<Object[]> callback) {
×
482
      this.signalType = signalType;
×
483
      this.description = "";
×
484
      this.unfinishedPolicy = unfinishedPolicy;
×
485
      this.argTypes = argTypes;
×
486
      this.genericArgTypes = genericArgTypes;
×
487
      this.callback = callback;
×
488
    }
×
489

490
    public SignalRegistrationRequest(
491
        String signalType,
492
        String description,
493
        HandlerUnfinishedPolicy unfinishedPolicy,
494
        Class<?>[] argTypes,
495
        Type[] genericArgTypes,
496
        Functions.Proc1<Object[]> callback) {
1✔
497
      this.signalType = signalType;
1✔
498
      this.description = description;
1✔
499
      this.unfinishedPolicy = unfinishedPolicy;
1✔
500
      this.argTypes = argTypes;
1✔
501
      this.genericArgTypes = genericArgTypes;
1✔
502
      this.callback = callback;
1✔
503
    }
1✔
504

505
    public String getSignalType() {
506
      return signalType;
1✔
507
    }
508

509
    @Experimental
510
    public String getDescription() {
511
      return description;
1✔
512
    }
513

514
    public HandlerUnfinishedPolicy getUnfinishedPolicy() {
515
      return unfinishedPolicy;
1✔
516
    }
517

518
    public Class<?>[] getArgTypes() {
519
      return argTypes;
1✔
520
    }
521

522
    public Type[] getGenericArgTypes() {
523
      return genericArgTypes;
1✔
524
    }
525

526
    public Functions.Proc1<Object[]> getCallback() {
527
      return callback;
1✔
528
    }
529
  }
530

531
  final class RegisterSignalHandlersInput {
532
    private final List<SignalRegistrationRequest> requests;
533

534
    public RegisterSignalHandlersInput(List<SignalRegistrationRequest> requests) {
1✔
535
      this.requests = requests;
1✔
536
    }
1✔
537

538
    public List<SignalRegistrationRequest> getRequests() {
539
      return requests;
1✔
540
    }
541
  }
542

543
  @Experimental
544
  final class UpdateRegistrationRequest {
545
    private final String updateName;
546
    private final String description;
547
    private final HandlerUnfinishedPolicy unfinishedPolicy;
548
    private final Class<?>[] argTypes;
549
    private final Type[] genericArgTypes;
550
    private final Functions.Func1<Object[], Object> executeCallback;
551
    private final Functions.Proc1<Object[]> validateCallback;
552

553
    // Kept for backward compatibility
554
    public UpdateRegistrationRequest(
555
        String updateName,
556
        HandlerUnfinishedPolicy unfinishedPolicy,
557
        Class<?>[] argTypes,
558
        Type[] genericArgTypes,
559
        Functions.Proc1<Object[]> validateCallback,
560
        Functions.Func1<Object[], Object> executeCallback) {
×
561
      this.updateName = updateName;
×
562
      this.description = "";
×
563
      this.unfinishedPolicy = unfinishedPolicy;
×
564
      this.argTypes = argTypes;
×
565
      this.genericArgTypes = genericArgTypes;
×
566
      this.validateCallback = validateCallback;
×
567
      this.executeCallback = executeCallback;
×
568
    }
×
569

570
    public UpdateRegistrationRequest(
571
        String updateName,
572
        String description,
573
        HandlerUnfinishedPolicy unfinishedPolicy,
574
        Class<?>[] argTypes,
575
        Type[] genericArgTypes,
576
        Functions.Proc1<Object[]> validateCallback,
577
        Functions.Func1<Object[], Object> executeCallback) {
1✔
578
      this.updateName = updateName;
1✔
579
      this.description = description;
1✔
580
      this.unfinishedPolicy = unfinishedPolicy;
1✔
581
      this.argTypes = argTypes;
1✔
582
      this.genericArgTypes = genericArgTypes;
1✔
583
      this.validateCallback = validateCallback;
1✔
584
      this.executeCallback = executeCallback;
1✔
585
    }
1✔
586

587
    public String getUpdateName() {
588
      return updateName;
1✔
589
    }
590

591
    @Experimental
592
    public String getDescription() {
593
      return description;
1✔
594
    }
595

596
    public HandlerUnfinishedPolicy getUnfinishedPolicy() {
597
      return unfinishedPolicy;
1✔
598
    }
599

600
    public Class<?>[] getArgTypes() {
601
      return argTypes;
1✔
602
    }
603

604
    public Type[] getGenericArgTypes() {
605
      return genericArgTypes;
1✔
606
    }
607

608
    public Functions.Proc1<Object[]> getValidateCallback() {
609
      return validateCallback;
1✔
610
    }
611

612
    public Functions.Func1<Object[], Object> getExecuteCallback() {
613
      return executeCallback;
1✔
614
    }
615
  }
616

617
  @Experimental
618
  final class RegisterUpdateHandlersInput {
619
    private final List<UpdateRegistrationRequest> requests;
620

621
    public RegisterUpdateHandlersInput(List<UpdateRegistrationRequest> requests) {
1✔
622
      this.requests = requests;
1✔
623
    }
1✔
624

625
    public List<UpdateRegistrationRequest> getRequests() {
626
      return requests;
1✔
627
    }
628
  }
629

630
  final class RegisterQueryInput {
631
    private final String queryType;
632
    private final String description;
633
    private final Class<?>[] argTypes;
634
    private final Type[] genericArgTypes;
635
    private final Functions.Func1<Object[], Object> callback;
636

637
    // Kept for backward compatibility
638
    public RegisterQueryInput(
639
        String queryType,
640
        Class<?>[] argTypes,
641
        Type[] genericArgTypes,
642
        Functions.Func1<Object[], Object> callback) {
1✔
643
      this.queryType = queryType;
1✔
644
      this.description = "";
1✔
645
      this.argTypes = argTypes;
1✔
646
      this.genericArgTypes = genericArgTypes;
1✔
647
      this.callback = callback;
1✔
648
    }
1✔
649

650
    public RegisterQueryInput(
651
        String queryType,
652
        String description,
653
        Class<?>[] argTypes,
654
        Type[] genericArgTypes,
655
        Functions.Func1<Object[], Object> callback) {
1✔
656
      this.queryType = queryType;
1✔
657
      this.description = description;
1✔
658
      this.argTypes = argTypes;
1✔
659
      this.genericArgTypes = genericArgTypes;
1✔
660
      this.callback = callback;
1✔
661
    }
1✔
662

663
    public String getQueryType() {
664
      return queryType;
1✔
665
    }
666

667
    @Experimental
668
    public String getDescription() {
669
      return description;
1✔
670
    }
671

672
    public Class<?>[] getArgTypes() {
673
      return argTypes;
1✔
674
    }
675

676
    public Type[] getGenericArgTypes() {
677
      return genericArgTypes;
1✔
678
    }
679

680
    public Functions.Func1<Object[], Object> getCallback() {
681
      return callback;
1✔
682
    }
683
  }
684

685
  final class RegisterDynamicQueryHandlerInput {
686
    private final DynamicQueryHandler handler;
687

688
    public RegisterDynamicQueryHandlerInput(DynamicQueryHandler handler) {
1✔
689
      this.handler = handler;
1✔
690
    }
1✔
691

692
    public DynamicQueryHandler getHandler() {
693
      return handler;
1✔
694
    }
695
  }
696

697
  final class RegisterDynamicSignalHandlerInput {
698
    private final DynamicSignalHandler handler;
699

700
    public RegisterDynamicSignalHandlerInput(DynamicSignalHandler handler) {
1✔
701
      this.handler = handler;
1✔
702
    }
1✔
703

704
    public DynamicSignalHandler getHandler() {
705
      return handler;
1✔
706
    }
707
  }
708

709
  @Experimental
710
  final class RegisterDynamicUpdateHandlerInput {
711
    private final DynamicUpdateHandler handler;
712

713
    public RegisterDynamicUpdateHandlerInput(DynamicUpdateHandler handler) {
1✔
714
      this.handler = handler;
1✔
715
    }
1✔
716

717
    public DynamicUpdateHandler getHandler() {
718
      return handler;
1✔
719
    }
720
  }
721

722
  <R> ActivityOutput<R> executeActivity(ActivityInput<R> input);
723

724
  <R> LocalActivityOutput<R> executeLocalActivity(LocalActivityInput<R> input);
725

726
  <R> ChildWorkflowOutput<R> executeChildWorkflow(ChildWorkflowInput<R> input);
727

728
  @Experimental
729
  <R> ExecuteNexusOperationOutput<R> executeNexusOperation(ExecuteNexusOperationInput<R> input);
730

731
  Random newRandom();
732

733
  SignalExternalOutput signalExternalWorkflow(SignalExternalInput input);
734

735
  CancelWorkflowOutput cancelWorkflow(CancelWorkflowInput input);
736

737
  void sleep(Duration duration);
738

739
  boolean await(Duration timeout, String reason, Supplier<Boolean> unblockCondition);
740

741
  void await(String reason, Supplier<Boolean> unblockCondition);
742

743
  Promise<Void> newTimer(Duration duration);
744

745
  Promise<Void> newTimer(Duration duration, TimerOptions options);
746

747
  <R> R sideEffect(Class<R> resultClass, Type resultType, Func<R> func);
748

749
  <R> R mutableSideEffect(
750
      String id, Class<R> resultClass, Type resultType, BiPredicate<R, R> updated, Func<R> func);
751

752
  int getVersion(String changeId, int minSupported, int maxSupported);
753

754
  void continueAsNew(ContinueAsNewInput input);
755

756
  void registerQuery(RegisterQueryInput input);
757

758
  void registerSignalHandlers(RegisterSignalHandlersInput input);
759

760
  @Experimental
761
  void registerUpdateHandlers(RegisterUpdateHandlersInput input);
762

763
  void registerDynamicSignalHandler(RegisterDynamicSignalHandlerInput handler);
764

765
  void registerDynamicQueryHandler(RegisterDynamicQueryHandlerInput input);
766

767
  @Experimental
768
  void registerDynamicUpdateHandler(RegisterDynamicUpdateHandlerInput input);
769

770
  UUID randomUUID();
771

772
  void upsertSearchAttributes(Map<String, ?> searchAttributes);
773

774
  void upsertTypedSearchAttributes(SearchAttributeUpdate<?>... searchAttributeUpdates);
775

776
  void upsertMemo(Map<String, Object> memo);
777

778
  /** Intercepts call to get the metric scope in a workflow. */
779
  Scope getMetricsScope();
780

781
  /**
782
   * Intercepts creation of a workflow child thread.
783
   *
784
   * <p>Please note, that "workflow child thread" and "child workflow" are different and independent
785
   * concepts.
786
   *
787
   * @param runnable thread function to run
788
   * @param detached if this thread is detached from the parent {@link CancellationScope}
789
   * @param name name of the thread
790
   * @return created WorkflowThread
791
   */
792
  Object newChildThread(Runnable runnable, boolean detached, String name);
793

794
  long currentTimeMillis();
795
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc