@@ -64,6 +64,7 @@ public static WorkflowOptions merge(
64
64
.setRetryOptions (RetryOptions .merge (methodRetry , o .getRetryOptions ()))
65
65
.setCronSchedule (OptionsUtils .merge (cronAnnotation , o .getCronSchedule (), String .class ))
66
66
.setMemo (o .getMemo ())
67
+ .setSearchAttributes (o .getSearchAttributes ())
67
68
.validateBuildWithDefaults ();
68
69
}
69
70
@@ -87,6 +88,8 @@ public static final class Builder {
87
88
88
89
private Map <String , Object > memo ;
89
90
91
+ private Map <String , Object > searchAttributes ;
92
+
90
93
public Builder () {}
91
94
92
95
public Builder (WorkflowOptions o ) {
@@ -102,6 +105,7 @@ public Builder(WorkflowOptions o) {
102
105
this .retryOptions = o .retryOptions ;
103
106
this .cronSchedule = o .cronSchedule ;
104
107
this .memo = o .memo ;
108
+ this .searchAttributes = o .searchAttributes ;
105
109
}
106
110
107
111
/**
@@ -186,12 +190,24 @@ public Builder setCronSchedule(String cronSchedule) {
186
190
return this ;
187
191
}
188
192
189
- /** Specifies additional non-indexed information in result of list workflow. */
193
+ /**
194
+ * Specifies additional non-indexed information in result of list workflow. The type of value
195
+ * can be any object that are serializable by {@link com.uber.cadence.converter.DataConverter}
196
+ */
190
197
public Builder setMemo (Map <String , Object > memo ) {
191
198
this .memo = memo ;
192
199
return this ;
193
200
}
194
201
202
+ /**
203
+ * Specifies additional indexed information in result of list workflow. The type of value should
204
+ * be basic type such as: String, Integer, Boolean, Double,LocalDateTime
205
+ */
206
+ public Builder setSearchAttributes (Map <String , Object > searchAttributes ) {
207
+ this .searchAttributes = searchAttributes ;
208
+ return this ;
209
+ }
210
+
195
211
public WorkflowOptions build () {
196
212
return new WorkflowOptions (
197
213
workflowId ,
@@ -202,7 +218,8 @@ public WorkflowOptions build() {
202
218
childPolicy ,
203
219
retryOptions ,
204
220
cronSchedule ,
205
- memo );
221
+ memo ,
222
+ searchAttributes );
206
223
}
207
224
208
225
/**
@@ -248,7 +265,8 @@ public WorkflowOptions validateBuildWithDefaults() {
248
265
childPolicy ,
249
266
retryOptions ,
250
267
cronSchedule ,
251
- memo );
268
+ memo ,
269
+ searchAttributes );
252
270
}
253
271
}
254
272
@@ -270,6 +288,8 @@ public WorkflowOptions validateBuildWithDefaults() {
270
288
271
289
private Map <String , Object > memo ;
272
290
291
+ private Map <String , Object > searchAttributes ;
292
+
273
293
private WorkflowOptions (
274
294
String workflowId ,
275
295
WorkflowIdReusePolicy workflowIdReusePolicy ,
@@ -279,7 +299,8 @@ private WorkflowOptions(
279
299
ChildPolicy childPolicy ,
280
300
RetryOptions retryOptions ,
281
301
String cronSchedule ,
282
- Map <String , Object > memo ) {
302
+ Map <String , Object > memo ,
303
+ Map <String , Object > searchAttributes ) {
283
304
this .workflowId = workflowId ;
284
305
this .workflowIdReusePolicy = workflowIdReusePolicy ;
285
306
this .executionStartToCloseTimeout = executionStartToCloseTimeout ;
@@ -289,6 +310,7 @@ private WorkflowOptions(
289
310
this .retryOptions = retryOptions ;
290
311
this .cronSchedule = cronSchedule ;
291
312
this .memo = memo ;
313
+ this .searchAttributes = searchAttributes ;
292
314
}
293
315
294
316
public String getWorkflowId () {
@@ -327,6 +349,10 @@ public Map<String, Object> getMemo() {
327
349
return memo ;
328
350
}
329
351
352
+ public Map <String , Object > getSearchAttributes () {
353
+ return searchAttributes ;
354
+ }
355
+
330
356
@ Override
331
357
public boolean equals (Object o ) {
332
358
if (this == o ) return true ;
@@ -340,7 +366,8 @@ public boolean equals(Object o) {
340
366
&& childPolicy == that .childPolicy
341
367
&& Objects .equals (retryOptions , that .retryOptions )
342
368
&& Objects .equals (cronSchedule , that .cronSchedule )
343
- && Objects .equals (memo , that .memo );
369
+ && Objects .equals (memo , that .memo )
370
+ && Objects .equals (searchAttributes , that .searchAttributes );
344
371
}
345
372
346
373
@ Override
@@ -354,7 +381,8 @@ public int hashCode() {
354
381
childPolicy ,
355
382
retryOptions ,
356
383
cronSchedule ,
357
- memo );
384
+ memo ,
385
+ searchAttributes );
358
386
}
359
387
360
388
@ Override
@@ -382,6 +410,9 @@ public String toString() {
382
410
+ ", memo='"
383
411
+ memo
384
412
+ '\''
413
+ + ", searchAttributes='"
414
+ + searchAttributes
415
+ + '\''
385
416
+ '}' ;
386
417
}
387
418
}
0 commit comments