feat(updatePropertiesAction): support add values to a SET in a profile property
@@ -37,6 +37,7 @@ public class UpdatePropertiesAction implements ActionExecutor {
public static final String PROPS_TO_ADD = "add";
public static final String PROPS_TO_UPDATE = "update";
public static final String PROPS_TO_DELETE = "delete";
+ public static final String PROPS_TO_ADD_TO_SET = "addToSet";
public static final String TARGET_ID_KEY = "targetId";
public static final String TARGET_TYPE_KEY = "targetType";
@@ -76,6 +77,11 @@ public class UpdatePropertiesAction implements ActionExecutor {
isProfileOrPersonaUpdated |= processProperties(target, propsToUpdate, "alwaysSet");
}
+ Map<String, Object> propsToAddToSet = (HashMap<String, Object>) event.getProperties().get(PROPS_TO_ADD_TO_SET);
+ if (propsToAddToSet != null) {
+ isProfileOrPersonaUpdated |= processProperties(target, propsToAddToSet, "addValues");
+ }
+
List<String> propsToDelete = (List<String>) event.getProperties().get(PROPS_TO_DELETE);
if (propsToDelete != null) {
for (String prop : propsToDelete) {
