File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
common/src/main/java/com/netflix/conductor/common/metadata/workflow
java/com/netflix/conductor/grpc Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,9 @@ public enum TimeoutPolicy {
106
106
@ ProtoField (id = 21 )
107
107
private boolean enforceSchema = true ;
108
108
109
+ @ ProtoField (id = 22 )
110
+ private Map <String , Object > metadata = new HashMap <>();
111
+
109
112
public boolean isEnforceSchema () {
110
113
return enforceSchema ;
111
114
}
@@ -366,6 +369,14 @@ public void setOutputSchema(SchemaDef outputSchema) {
366
369
this .outputSchema = outputSchema ;
367
370
}
368
371
372
+ public Map <String , Object > getMetadata () {
373
+ return metadata ;
374
+ }
375
+
376
+ public void setMetadata (Map <String , Object > metadata ) {
377
+ this .metadata = metadata ;
378
+ }
379
+
369
380
public boolean containsType (String taskType ) {
370
381
return collectTasks ().stream ().anyMatch (t -> t .getType ().equals (taskType ));
371
382
}
Original file line number Diff line number Diff line change @@ -1339,6 +1339,9 @@ public WorkflowDefPb.WorkflowDef toProto(WorkflowDef from) {
1339
1339
to .setOutputSchema ( toProto ( from .getOutputSchema () ) );
1340
1340
}
1341
1341
to .setEnforceSchema ( from .isEnforceSchema () );
1342
+ for (Map .Entry <String , Object > pair : from .getMetadata ().entrySet ()) {
1343
+ to .putMetadata ( pair .getKey (), toProto ( pair .getValue () ) );
1344
+ }
1342
1345
return to .build ();
1343
1346
}
1344
1347
@@ -1382,6 +1385,11 @@ public WorkflowDef fromProto(WorkflowDefPb.WorkflowDef from) {
1382
1385
to .setOutputSchema ( fromProto ( from .getOutputSchema () ) );
1383
1386
}
1384
1387
to .setEnforceSchema ( from .getEnforceSchema () );
1388
+ Map <String , Object > metadataMap = new HashMap <String , Object >();
1389
+ for (Map .Entry <String , Value > pair : from .getMetadataMap ().entrySet ()) {
1390
+ metadataMap .put ( pair .getKey (), fromProto ( pair .getValue () ) );
1391
+ }
1392
+ to .setMetadata (metadataMap );
1385
1393
return to ;
1386
1394
}
1387
1395
Original file line number Diff line number Diff line change @@ -35,4 +35,5 @@ message WorkflowDef {
35
35
SchemaDef input_schema = 19 ;
36
36
SchemaDef output_schema = 20 ;
37
37
bool enforce_schema = 21 ;
38
+ map <string , google.protobuf.Value > metadata = 22 ;
38
39
}
You can’t perform that action at this time.
0 commit comments