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

temporalio / sdk-java / #175

pending completion
#175

push

github-actions

web-flow
Worker / Build Id versioning (#1786)

Implement new worker build id based versioning feature

236 of 236 new or added lines in 24 files covered. (100.0%)

18343 of 23697 relevant lines covered (77.41%)

0.81 hits per line

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

35.71
/temporal-sdk/src/main/java/io/temporal/internal/sync/WorkflowInfoImpl.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.internal.sync;
22

23
import io.temporal.api.common.v1.SearchAttributes;
24
import io.temporal.api.common.v1.WorkflowExecution;
25
import io.temporal.internal.replay.ReplayWorkflowContext;
26
import io.temporal.workflow.WorkflowInfo;
27
import java.time.Duration;
28
import java.util.Optional;
29
import javax.annotation.Nonnull;
30
import javax.annotation.Nullable;
31

32
final class WorkflowInfoImpl implements WorkflowInfo {
33

34
  private final ReplayWorkflowContext context;
35

36
  WorkflowInfoImpl(ReplayWorkflowContext context) {
1✔
37
    this.context = context;
1✔
38
  }
1✔
39

40
  @Override
41
  public String getNamespace() {
42
    return context.getNamespace();
×
43
  }
44

45
  @Override
46
  public String getWorkflowId() {
47
    return context.getWorkflowId();
1✔
48
  }
49

50
  @Override
51
  public String getWorkflowType() {
52
    return context.getWorkflowType().getName();
1✔
53
  }
54

55
  @Nonnull
56
  @Override
57
  public String getRunId() {
58
    return context.getRunId();
1✔
59
  }
60

61
  @Nonnull
62
  @Override
63
  public String getFirstExecutionRunId() {
64
    return context.getFirstExecutionRunId();
×
65
  }
66

67
  @Override
68
  public Optional<String> getContinuedExecutionRunId() {
69
    return context.getContinuedExecutionRunId();
1✔
70
  }
71

72
  @Nonnull
73
  @Override
74
  public String getOriginalExecutionRunId() {
75
    return context.getOriginalExecutionRunId();
×
76
  }
77

78
  @Override
79
  public String getTaskQueue() {
80
    return context.getTaskQueue();
1✔
81
  }
82

83
  @Override
84
  public Duration getWorkflowRunTimeout() {
85
    return context.getWorkflowRunTimeout();
×
86
  }
87

88
  @Override
89
  public Duration getWorkflowExecutionTimeout() {
90
    return context.getWorkflowExecutionTimeout();
×
91
  }
92

93
  @Override
94
  public long getRunStartedTimestampMillis() {
95
    return context.getRunStartedTimestampMillis();
×
96
  }
97

98
  @Override
99
  @SuppressWarnings("deprecation")
100
  @Nullable
101
  public SearchAttributes getSearchAttributes() {
102
    return context.getSearchAttributes();
×
103
  }
104

105
  @Override
106
  public Optional<String> getParentWorkflowId() {
107
    WorkflowExecution parentWorkflowExecution = context.getParentWorkflowExecution();
1✔
108
    return parentWorkflowExecution == null
1✔
109
        ? Optional.empty()
1✔
110
        : Optional.of(parentWorkflowExecution.getWorkflowId());
1✔
111
  }
112

113
  @Override
114
  public Optional<String> getParentRunId() {
115
    WorkflowExecution parentWorkflowExecution = context.getParentWorkflowExecution();
×
116
    return parentWorkflowExecution == null
×
117
        ? Optional.empty()
×
118
        : Optional.of(parentWorkflowExecution.getRunId());
×
119
  }
120

121
  @Override
122
  public int getAttempt() {
123
    return context.getAttempt();
1✔
124
  }
125

126
  @Override
127
  public String getCronSchedule() {
128
    return context.getCronSchedule();
1✔
129
  }
130

131
  @Override
132
  public long getHistoryLength() {
133
    return context.getCurrentWorkflowTaskStartedEventId();
1✔
134
  }
135

136
  @Override
137
  public String toString() {
138
    return "WorkflowInfo{"
×
139
        + "namespace="
140
        + getNamespace()
×
141
        + ", workflowId="
142
        + getWorkflowId()
×
143
        + ", runId="
144
        + getRunId()
×
145
        + ", workflowType="
146
        + getWorkflowType()
×
147
        + ", continuedExecutionRunId="
148
        + getContinuedExecutionRunId()
×
149
        + ", taskQueue='"
150
        + getTaskQueue()
×
151
        + '\''
152
        + ", workflowRunTimeout="
153
        + getWorkflowRunTimeout()
×
154
        + ", workflowExecutionTimeout="
155
        + getWorkflowExecutionTimeout()
×
156
        + ", runStartedTimestampMillis="
157
        + getRunStartedTimestampMillis()
×
158
        + ", searchAttributes="
159
        + getSearchAttributes()
×
160
        + ", parentWorkflowId="
161
        + getParentWorkflowId()
×
162
        + ", parentRunId="
163
        + getParentRunId()
×
164
        + ", attempt="
165
        + getAttempt()
×
166
        + ", cronSchedule="
167
        + getCronSchedule()
×
168
        + ", historyLength="
169
        + getHistoryLength()
×
170
        + '}';
171
  }
172
}
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