You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by GitBox <gi...@apache.org> on 2022/06/20 07:57:06 UTC

[GitHub] [unomi] jkevan commented on a diff in pull request #441: UNOMI-597: do not persist internal events

jkevan commented on code in PR #441:
URL: https://github.com/apache/unomi/pull/441#discussion_r901362674


##########
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SendEventAction.java:
##########
@@ -36,18 +37,19 @@ public void setEventService(EventService eventService) {
     @Override
     public int execute(Action action, Event event) {
         String eventType = (String) action.getParameterValues().get("eventType");
+        Boolean toBePersisted = (Boolean) action.getParameterValues().get("toBePersisted");
+
         @SuppressWarnings("unchecked")
         Map<String, Object> eventProperties = (Map<String, Object>) action.getParameterValues().get("eventProperties");
         Item target = (Item) action.getParameterValues().get("eventTarget");
-//        String type = (String) target.get("type");
-
-//            Item targetItem = new CustomItem();
-//            BeanUtils.populate(targetItem, target);
 
         Event subEvent = new Event(eventType, event.getSession(), event.getProfile(), event.getSourceId(), event, target, event.getTimeStamp());
         subEvent.setProfileId(event.getProfileId());
         subEvent.getAttributes().putAll(event.getAttributes());
         subEvent.getProperties().putAll(eventProperties);
+        if(!toBePersisted){

Review Comment:
   Missing null check, this parameter was not existing before, there is a chance that is will be null.
   If null we should continue to have the same behavior as before for compatibility reasons.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org