How to upsert custom Search Attributes
In your Workflow code, call the upsertSearchAttributes(Map<String, ?> searchAttributes)
method.
Map<String, Object> attr1 = new HashMap<>();
attr1.put("CustomIntField", 1);
attr1.put("CustomBoolField", true);
Workflow.upsertSearchAttributes(attr1);
Map<String, Object> attr2 = new HashMap<>();
attr2.put("CustomIntField", Lists.newArrayList(1, 2));
attr2.put("CustomKeywordField", "Seattle");
Workflow.upsertSearchAttributes(attr2);
The results of upsertSearchAttributes()
output the following search attributes.
{
"CustomIntField": 1, 2,
"CustomBoolField": true,
"CustomKeywordField": "Seattle",
}