private boolean processProperties(Profile target, Map<String, Object> propsMap, String strategy) { boolean isProfileOrPersonaUpdated = false; for (String prop : propsMap.keySet()) { PropertyType propType = null; if (prop.startsWith("properties.") || prop.startsWith("systemProperties.")) { propType = profileService.getPropertyType(prop.substring(prop.indexOf('.') + 1)); } else { propType = profileService.getPropertyType(prop); //ideally each property must have a matching propertyType if(prop.equals("segments")) { propsMap.put(prop, new HashSet<String>((ArrayList<String>)propsMap.get(prop))); } } if (propType != null) { isProfileOrPersonaUpdated |= PropertyHelper.setProperty(target, prop, PropertyHelper.getValueByTypeId(propsMap.get(prop), propType.getValueTypeId()), "alwaysSet"); } else { isProfileOrPersonaUpdated |= PropertyHelper.setProperty(target, prop, propsMap.get(prop), strategy); } } return isProfileOrPersonaUpdated; }
if (PropertyHelper.setProperty(event.getSession(), propertyName, propertyValue, (String) action.getParameterValues().get("setPropertyStrategy"))) { return EventService.SESSION_UPDATED; if (PropertyHelper.setProperty(event.getProfile(), propertyName, propertyValue, (String) action.getParameterValues().get("setPropertyStrategy"))) { return EventService.PROFILE_UPDATED;
if (propsToDelete != null) { for (String prop : propsToDelete) { isProfileOrPersonaUpdated |= PropertyHelper.setProperty(target, prop, null, "remove");
public void batchProfilesUpdate(BatchUpdate update) { ParserHelper.resolveConditionType(definitionsService, update.getCondition()); List<Profile> profiles = persistenceService.query(update.getCondition(), null, Profile.class); for (Profile profile : profiles) { if (PropertyHelper.setProperty(profile, update.getPropertyName(), update.getPropertyValue(), update.getStrategy())) { save(profile); } } }
public void batchProfilesUpdate(BatchUpdate update) { ParserHelper.resolveConditionType(definitionsService, update.getCondition()); List<Profile> profiles = persistenceService.query(update.getCondition(), null, Profile.class); for (Profile profile : profiles) { if (PropertyHelper.setProperty(profile, update.getPropertyName(), update.getPropertyValue(), update.getStrategy())) { save(profile); } } }