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

uber / cadence-java-client / 1693

pending completion
1693

push

buildkite

GitHub
Add executeWorkflow method for WorkflowInterceptor to match go client library (#779)

* executeWorkflowPath 
-- added executeWorkflow method
-- added ExecutionInput class for getting input
-- fixed tracer and tests

15 of 15 new or added lines in 5 files covered. (100.0%)

11125 of 18391 relevant lines covered (60.49%)

0.6 hits per line

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

11.11
/src/main/java/com/uber/cadence/workflow/WorkflowInterceptorBase.java
1
/*
2
 *  Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
 *
4
 *  Modifications copyright (C) 2017 Uber Technologies, Inc.
5
 *
6
 *  Licensed under the Apache License, Version 2.0 (the "License"). You may not
7
 *  use this file except in compliance with the License. A copy of the License is
8
 *  located at
9
 *
10
 *  http://aws.amazon.com/apache2.0
11
 *
12
 *  or in the "license" file accompanying this file. This file is distributed on
13
 *  an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
 *  express or implied. See the License for the specific language governing
15
 *  permissions and limitations under the License.
16
 */
17

18
package com.uber.cadence.workflow;
19

20
import com.uber.cadence.WorkflowExecution;
21
import com.uber.cadence.activity.ActivityOptions;
22
import com.uber.cadence.activity.LocalActivityOptions;
23
import com.uber.cadence.internal.sync.SyncWorkflowDefinition;
24
import com.uber.cadence.workflow.Functions.Func;
25
import com.uber.cadence.workflow.Functions.Func1;
26
import java.lang.reflect.Type;
27
import java.time.Duration;
28
import java.util.*;
29
import java.util.function.BiPredicate;
30
import java.util.function.Supplier;
31

32
/** Convenience base class for WorkflowInterceptor implementations. */
33
public class WorkflowInterceptorBase implements WorkflowInterceptor {
34

35
  private final WorkflowInterceptor next;
36

37
  public WorkflowInterceptorBase(WorkflowInterceptor next) {
1✔
38
    this.next = next;
1✔
39
  }
1✔
40

41
  // base interceptor executeWorkflow method: no-op interceptors delegate calls to next interceptors
42
  // used for users to create new interceptors easily
43
  @Override
44
  public byte[] executeWorkflow(
45
      SyncWorkflowDefinition workflowDefinition, WorkflowExecuteInput input) {
46
    return next.executeWorkflow(workflowDefinition, input);
×
47
  }
48

49
  @Override
50
  public <R> Promise<R> executeActivity(
51
      String activityName,
52
      Class<R> resultClass,
53
      Type resultType,
54
      Object[] args,
55
      ActivityOptions options) {
56
    return next.executeActivity(activityName, resultClass, resultType, args, options);
×
57
  }
58

59
  @Override
60
  public <R> Promise<R> executeLocalActivity(
61
      String activityName,
62
      Class<R> resultClass,
63
      Type resultType,
64
      Object[] args,
65
      LocalActivityOptions options) {
66
    return next.executeLocalActivity(activityName, resultClass, resultType, args, options);
×
67
  }
68

69
  @Override
70
  public <R> WorkflowResult<R> executeChildWorkflow(
71
      String workflowType,
72
      Class<R> resultClass,
73
      Type resultType,
74
      Object[] args,
75
      ChildWorkflowOptions options) {
76
    return next.executeChildWorkflow(workflowType, resultClass, resultType, args, options);
×
77
  }
78

79
  @Override
80
  public Random newRandom() {
81
    return next.newRandom();
×
82
  }
83

84
  @Override
85
  public Promise<Void> signalExternalWorkflow(
86
      WorkflowExecution execution, String signalName, Object[] args) {
87
    return next.signalExternalWorkflow(execution, signalName, args);
×
88
  }
89

90
  @Override
91
  public Promise<Void> signalExternalWorkflow(
92
      String domain, WorkflowExecution execution, String signalName, Object[] args) {
93
    return next.signalExternalWorkflow(domain, execution, signalName, args);
×
94
  }
95

96
  @Override
97
  public Promise<Void> cancelWorkflow(WorkflowExecution execution) {
98
    return next.cancelWorkflow(execution);
×
99
  }
100

101
  @Override
102
  public void sleep(Duration duration) {
103
    next.sleep(duration);
×
104
  }
×
105

106
  @Override
107
  public boolean await(Duration timeout, String reason, Supplier<Boolean> unblockCondition) {
108
    return next.await(timeout, reason, unblockCondition);
×
109
  }
110

111
  @Override
112
  public void await(String reason, Supplier<Boolean> unblockCondition) {
113
    next.await(reason, unblockCondition);
×
114
  }
×
115

116
  @Override
117
  public Promise<Void> newTimer(Duration duration) {
118
    return next.newTimer(duration);
×
119
  }
120

121
  @Override
122
  public <R> R sideEffect(Class<R> resultClass, Type resultType, Func<R> func) {
123
    return next.sideEffect(resultClass, resultType, func);
×
124
  }
125

126
  @Override
127
  public <R> R mutableSideEffect(
128
      String id, Class<R> resultClass, Type resultType, BiPredicate<R, R> updated, Func<R> func) {
129
    return next.mutableSideEffect(id, resultClass, resultType, updated, func);
×
130
  }
131

132
  @Override
133
  public int getVersion(String changeID, int minSupported, int maxSupported) {
134
    return next.getVersion(changeID, minSupported, maxSupported);
×
135
  }
136

137
  @Override
138
  public void continueAsNew(
139
      Optional<String> workflowType, Optional<ContinueAsNewOptions> options, Object[] args) {
140
    next.continueAsNew(workflowType, options, args);
×
141
  }
×
142

143
  @Override
144
  public void registerQuery(String queryType, Type[] argTypes, Func1<Object[], Object> callback) {
145
    next.registerQuery(queryType, argTypes, callback);
×
146
  }
×
147

148
  @Override
149
  public UUID randomUUID() {
150
    return next.randomUUID();
×
151
  }
152

153
  @Override
154
  public void upsertSearchAttributes(Map<String, Object> searchAttributes) {
155
    next.upsertSearchAttributes(searchAttributes);
×
156
  }
×
157
}
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