Restore session storage in setPropertyAction
@@ -66,6 +66,15 @@ public class SetPropertyAction implements ActionExecutor {
propertyValue = format.format(event.getTimeStamp());
}
+ if (storeInSession) {
+ // in the case of session storage we directly update the session
+ Object target = event.getSession();
+
+ if (PropertyHelper.setProperty(target, propertyName, propertyValue, (String) action.getParameterValues().get("setPropertyStrategy"))) {
+ return EventService.SESSION_UPDATED;
+ }
+ } else {
+ // in the case of profile storage we use the update profile properties event instead.
Map<String, Object> propertyToUpdate = new HashMap<>();
propertyToUpdate.put(propertyName, propertyValue);
@@ -73,7 +82,8 @@ public class SetPropertyAction implements ActionExecutor {
int changes = eventService.send(updateProfileProperties);
if ((changes & EventService.PROFILE_UPDATED) == EventService.PROFILE_UPDATED) {
- return storeInSession ? EventService.SESSION_UPDATED : EventService.PROFILE_UPDATED;
+ return EventService.PROFILE_UPDATED;
+ }
}
return EventService.NO_CHANGE;
