You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by jk...@apache.org on 2022/07/21 17:09:28 UTC

[unomi] branch migrateEvents updated: UNOMI-605: migrate events to 2.0.0

This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch migrateEvents
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/migrateEvents by this push:
     new b654b42a4 UNOMI-605: migrate events to 2.0.0
b654b42a4 is described below

commit b654b42a4876d378697ccd278ce983dc2a6d0b90
Author: Kevan <ke...@jahia.com>
AuthorDate: Thu Jul 21 19:08:21 2022 +0200

    UNOMI-605: migrate events to 2.0.0
---
 .../resources/requestBody/2.0.0/event_migrate.painless     | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/tools/shell-commands/src/main/resources/requestBody/2.0.0/event_migrate.painless b/tools/shell-commands/src/main/resources/requestBody/2.0.0/event_migrate.painless
index 4fd878064..5c8703dc8 100644
--- a/tools/shell-commands/src/main/resources/requestBody/2.0.0/event_migrate.painless
+++ b/tools/shell-commands/src/main/resources/requestBody/2.0.0/event_migrate.painless
@@ -41,15 +41,11 @@ if ('view' == ctx._source.eventType){
 }
 
 /* Handle form events */
-if ('form' == ctx._source.eventType){
+if ('form' == ctx._source.eventType && ctx._source.properties != null){
 
-    /* Check for form fields */
-    if (ctx._source.properties != null){
-
-        if (ctx._source.flattenedProperties == null) {
-            ctx._source.put('flattenedProperties', new HashMap());
-        }
-        ctx._source.flattenedProperties.put('fields', ctx._source.properties);
-        ctx._source.put('properties', new HashMap());
+    if (ctx._source.flattenedProperties == null) {
+        ctx._source.put('flattenedProperties', new HashMap());
     }
+    ctx._source.flattenedProperties.put('fields', ctx._source.properties);
+    ctx._source.put('properties', new HashMap());
 }
\ No newline at end of file