You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2021/10/04 12:57:16 UTC

[unomi] branch draft-custom-items updated (1919bc8 -> 4f2f288)

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

shuber pushed a change to branch draft-custom-items
in repository https://gitbox.apache.org/repos/asf/unomi.git.


    from 1919bc8  Support for custom items: - Made it possible to declare new custom item types that will inherit from the Item class and be loaded as CustomItem instances, but that can have any structure in the properties map. Custom item types have a "subtype" that defines its unique type and that is used to store the custom item objects in seperate indices in the persistence service. It is also possible to query custom item types using new methods in the PersistenceService SPI. Moved t [...]
     new da15dd4  Event type modifications for custom items
     new 4f2f288  Modify property condition builders to use collections instead of lists (works with sets now)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 itests/pom.xml                                     |  2 +-
 .../conditions/ConditionContextHelper.java         | 10 ++--
 .../PropertyConditionESQueryBuilder.java           | 24 ++++-----
 .../conditions/PropertyConditionEvaluator.java     | 61 ++++++++++++++++------
 .../META-INF/cxs/events/anonymizeProfile.json      |  4 ++
 .../META-INF/cxs/events/articleCompleted.json      |  8 +++
 .../main/resources/META-INF/cxs/events/form.json   |  8 +++
 .../main/resources/META-INF/cxs/events/goal.json   |  4 ++
 .../resources/META-INF/cxs/events/identify.json    |  4 ++
 .../META-INF/cxs/events/incrementInterest.json     |  4 ++
 .../main/resources/META-INF/cxs/events/login.json  |  8 +++
 .../META-INF/cxs/events/modifyConsent.json         |  8 +++
 .../META-INF/cxs/events/profileDeleted.json        |  4 ++
 .../META-INF/cxs/events/profileUpdated.json        |  4 ++
 .../resources/META-INF/cxs/events/ruleFired.json   |  4 ++
 .../main/resources/META-INF/cxs/events/search.json |  4 ++
 .../META-INF/cxs/events/sessionCreated.json        |  4 ++
 .../META-INF/cxs/events/sessionReassigned.json     |  4 ++
 .../META-INF/cxs/events/updateProperties.json      |  4 ++
 .../main/resources/META-INF/cxs/events/view.json   |  8 +++
 20 files changed, 146 insertions(+), 35 deletions(-)

[unomi] 02/02: Modify property condition builders to use collections instead of lists (works with sets now)

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch draft-custom-items
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 4f2f288a95cef2614cb75b2e2ab51d60d3ce5998
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Mon Oct 4 14:57:08 2021 +0200

    Modify property condition builders to use collections instead of lists (works with sets now)
---
 itests/pom.xml                                     |  2 +-
 .../conditions/ConditionContextHelper.java         | 10 ++--
 .../PropertyConditionESQueryBuilder.java           | 24 ++++-----
 .../conditions/PropertyConditionEvaluator.java     | 61 ++++++++++++++++------
 4 files changed, 62 insertions(+), 35 deletions(-)

diff --git a/itests/pom.xml b/itests/pom.xml
index e3bec40..50c1ccf 100644
--- a/itests/pom.xml
+++ b/itests/pom.xml
@@ -178,7 +178,7 @@
                             <autoCreateIndex>true</autoCreateIndex>
                             <timeout>120</timeout>
                             <environmentVariables>
-                                <ES_JAVA_OPTS>-Xms2g -Xmx2g</ES_JAVA_OPTS>
+                                <ES_JAVA_OPTS>-Xms4g -Xmx4g</ES_JAVA_OPTS>
                             </environmentVariables>
                             <instanceSettings>
                                 <properties>
diff --git a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/conditions/ConditionContextHelper.java b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/conditions/ConditionContextHelper.java
index 13bc667..211ed32 100644
--- a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/conditions/ConditionContextHelper.java
+++ b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/conditions/ConditionContextHelper.java
@@ -18,6 +18,7 @@
 package org.apache.unomi.persistence.elasticsearch.conditions;
 
 import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
 import com.google.common.collect.Lists;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.logging.log4j.core.util.IOUtils;
@@ -31,10 +32,7 @@ import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.io.Reader;
 import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 public class ConditionContextHelper {
     private static final Logger logger = LoggerFactory.getLogger(ConditionContextHelper.class);
@@ -144,9 +142,9 @@ public class ConditionContextHelper {
         return null;
     }
 
-    public static <T> List<T> foldToASCII(List<T> s) {
+    public static <T> Collection<T> foldToASCII(Collection<T> s) {
         if (s != null) {
-            return Lists.transform(s, new Function<T, T>() {
+            return Collections2.transform(s, new Function<T, T>() {
                 @Override
                 public T apply(T o) {
                     if (o instanceof String) {
diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionESQueryBuilder.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionESQueryBuilder.java
index 1613081..4f2612b 100644
--- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionESQueryBuilder.java
+++ b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionESQueryBuilder.java
@@ -31,10 +31,7 @@ import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormatter;
 import org.joda.time.format.ISODateTimeFormat;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 public class PropertyConditionESQueryBuilder implements ConditionESQueryBuilder {
 
@@ -59,15 +56,15 @@ public class PropertyConditionESQueryBuilder implements ConditionESQueryBuilder
         Object expectedValueDate = convertDateToISO(condition.getParameter("propertyValueDate"));
         Object expectedValueDateExpr = condition.getParameter("propertyValueDateExpr");
 
-        List<?> expectedValues = ConditionContextHelper.foldToASCII((List<?>) condition.getParameter("propertyValues"));
-        List<?> expectedValuesInteger = (List<?>) condition.getParameter("propertyValuesInteger");
-        List<?> expectedValuesDouble = (List<?>) condition.getParameter("propertyValuesDouble");
-        List<?> expectedValuesDate = convertDatesToISO((List<?>) condition.getParameter("propertyValuesDate"));
-        List<?> expectedValuesDateExpr = (List<?>) condition.getParameter("propertyValuesDateExpr");
+        Collection<?> expectedValues = ConditionContextHelper.foldToASCII((Collection<?>) condition.getParameter("propertyValues"));
+        Collection<?> expectedValuesInteger = (Collection<?>) condition.getParameter("propertyValuesInteger");
+        Collection<?> expectedValuesDouble = (Collection<?>) condition.getParameter("propertyValuesDouble");
+        Collection<?> expectedValuesDate = convertDatesToISO((Collection<?>) condition.getParameter("propertyValuesDate"));
+        Collection<?> expectedValuesDateExpr = (Collection<?>) condition.getParameter("propertyValuesDateExpr");
 
         Object value = ObjectUtils.firstNonNull(expectedValue, expectedValueInteger, expectedValueDouble, expectedValueDate, expectedValueDateExpr);
         @SuppressWarnings("unchecked")
-        List<?> values = ObjectUtils.firstNonNull(expectedValues, expectedValuesInteger, expectedValuesDouble, expectedValuesDate, expectedValuesDateExpr);
+        Collection<?> values = ObjectUtils.firstNonNull(expectedValues, expectedValuesInteger, expectedValuesDouble, expectedValuesDate, expectedValuesDateExpr);
 
         switch (comparisonOperator) {
             case "equals":
@@ -90,7 +87,8 @@ public class PropertyConditionESQueryBuilder implements ConditionESQueryBuilder
                 return QueryBuilders.rangeQuery(name).lte(value);
             case "between":
                 checkRequiredValuesSize(values, name, comparisonOperator, 2);
-                return QueryBuilders.rangeQuery(name).gte(values.get(0)).lte(values.get(1));
+                Iterator<?> iterator = values.iterator();
+                return QueryBuilders.rangeQuery(name).gte(iterator.next()).lte(iterator.next());
             case "exists":
                 return QueryBuilders.existsQuery(name);
             case "missing":
@@ -175,7 +173,7 @@ public class PropertyConditionESQueryBuilder implements ConditionESQueryBuilder
         return null;
     }
 
-    private void checkRequiredValuesSize(List<?> values, String name, String operator, int expectedSize) {
+    private void checkRequiredValuesSize(Collection<?> values, String name, String operator, int expectedSize) {
         if (values == null || values.size() != expectedSize) {
             throw new IllegalArgumentException("Impossible to build ES filter, missing " + expectedSize + " values for a condition using comparisonOperator: " + operator + ", and propertyName: " + name);
         }
@@ -205,7 +203,7 @@ public class PropertyConditionESQueryBuilder implements ConditionESQueryBuilder
         }
     }
 
-    private List<?> convertDatesToISO(List<?> datesValues) {
+    private Collection<?> convertDatesToISO(Collection<?> datesValues) {
         List<Object> results = new ArrayList<>();
         if (datesValues == null) {
             return null;
diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
index f637a7b..6a0aadc 100644
--- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
+++ b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
@@ -88,16 +88,16 @@ public class PropertyConditionEvaluator implements ConditionEvaluator {
         }
     }
 
-    private boolean compareMultivalue(Object actualValue, List<?> expectedValues, List<?> expectedValuesDate, List<?> expectedValuesNumber, List<?> expectedValuesDateExpr, String op) {
+    private boolean compareMultivalue(Object actualValue, Collection<?> expectedValues, Collection<?> expectedValuesDate, Collection<?> expectedValuesNumber, Collection<?> expectedValuesDateExpr, String op) {
         @SuppressWarnings("unchecked")
-        List<?> expected = ObjectUtils.firstNonNull(expectedValues, expectedValuesDate, expectedValuesNumber);
+        Collection<?> expected = ObjectUtils.firstNonNull(expectedValues, expectedValuesDate, expectedValuesNumber);
         if (actualValue == null) {
             return expected == null;
         } else if (expected == null) {
             return false;
         }
 
-        List<Object> actual = ConditionContextHelper.foldToASCII(getValueSet(actualValue));
+        Collection<Object> actual = ConditionContextHelper.foldToASCII(getValueSet(actualValue));
 
         boolean result = true;
 
@@ -241,16 +241,16 @@ public class PropertyConditionEvaluator implements ConditionEvaluator {
             List<?> expectedValuesDate = (List<?>) condition.getParameter("propertyValuesDate");
             List<?> expectedValuesDateExpr = (List<?>) condition.getParameter("propertyValuesDateExpr");
             return compare(actualValue, null,
-                    (expectedValuesDate != null && expectedValuesDate.size() >= 1) ? getDate(expectedValuesDate.get(0)) : null,
-                    (expectedValuesInteger != null && expectedValuesInteger.size() >= 1) ? (Integer) expectedValuesInteger.get(0) : null,
-                    (expectedValuesDateExpr != null && expectedValuesDateExpr.size() >= 1) ? (String) expectedValuesDateExpr.get(0) : null,
-                    (expectedValuesDouble != null && expectedValuesDouble.size() >= 1) ? (String) expectedValuesDouble.get(0) : null) >= 0
+                    getDate(getFirst(expectedValuesDate)),
+                    getFirst(expectedValuesInteger),
+                    getFirst(expectedValuesDateExpr),
+                    getFirst(expectedValuesDouble)) >= 0
                     &&
                     compare(actualValue, null,
-                            (expectedValuesDate != null && expectedValuesDate.size() >= 2) ? getDate(expectedValuesDate.get(1)) : null,
-                            (expectedValuesInteger != null && expectedValuesInteger.size() >= 2) ? (Integer) expectedValuesInteger.get(1) : null,
-                            (expectedValuesDateExpr != null && expectedValuesDateExpr.size() >= 2) ? (String) expectedValuesDateExpr.get(1) : null,
-                            (expectedValuesDouble != null && expectedValuesDouble.size() >= 2) ? (String) expectedValuesDouble.get(1) : null) <= 0;
+                            getDate(getSecond(expectedValuesDate)),
+                            getSecond(expectedValuesInteger),
+                            getSecond(expectedValuesDateExpr),
+                            getSecond(expectedValuesDouble)) <= 0;
         } else if (op.equals("contains")) {
             return actualValue.toString().contains(expectedValue);
         } else if (op.equals("notContains")) {
@@ -262,10 +262,10 @@ public class PropertyConditionEvaluator implements ConditionEvaluator {
         } else if (op.equals("matchesRegex")) {
             return expectedValue != null && Pattern.compile(expectedValue).matcher(actualValue.toString()).matches();
         } else if (op.equals("in") || op.equals("inContains") || op.equals("notIn") || op.equals("hasSomeOf") || op.equals("hasNoneOf") || op.equals("all")) {
-            List<?> expectedValues = ConditionContextHelper.foldToASCII((List<?>) condition.getParameter("propertyValues"));
-            List<?> expectedValuesInteger = (List<?>) condition.getParameter("propertyValuesInteger");
-            List<?> expectedValuesDate = (List<?>) condition.getParameter("propertyValuesDate");
-            List<?> expectedValuesDateExpr = (List<?>) condition.getParameter("propertyValuesDateExpr");
+            Collection<?> expectedValues = ConditionContextHelper.foldToASCII((Collection<?>) condition.getParameter("propertyValues"));
+            Collection<?> expectedValuesInteger = (Collection<?>) condition.getParameter("propertyValuesInteger");
+            Collection<?> expectedValuesDate = (Collection<?>) condition.getParameter("propertyValuesDate");
+            Collection<?> expectedValuesDateExpr = (Collection<?>) condition.getParameter("propertyValuesDateExpr");
 
             return compareMultivalue(actualValue, expectedValues, expectedValuesDate, expectedValuesInteger, expectedValuesDateExpr, op);
         } else if (op.equals("isDay") && expectedValueDate != null) {
@@ -464,4 +464,35 @@ public class PropertyConditionEvaluator implements ConditionEvaluator {
         }
     }
 
+    private Object getFirst(Collection<?> collection) {
+        if (collection == null) {
+            return null;
+        }
+        if (collection.isEmpty()) {
+            return null;
+        }
+        Iterator<?> iterator = collection.iterator();
+        if (iterator.hasNext()) {
+            return iterator.next();
+        }
+        return null;
+    }
+
+    private Object getSecond(Collection<?> collection) {
+        if (collection == null) {
+            return null;
+        }
+        if (collection.isEmpty()) {
+            return null;
+        }
+        Iterator<?> iterator = collection.iterator();
+        if (iterator.hasNext()) {
+            iterator.next();
+            if (iterator.hasNext()) {
+                return iterator.next();
+            }
+        }
+        return null;
+    }
+
 }

[unomi] 01/02: Event type modifications for custom items

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch draft-custom-items
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit da15dd4017b60c5228a40269f54ff730caeff725
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Wed Sep 29 09:21:57 2021 +0200

    Event type modifications for custom items
---
 .../src/main/resources/META-INF/cxs/events/anonymizeProfile.json  | 4 ++++
 .../src/main/resources/META-INF/cxs/events/articleCompleted.json  | 8 ++++++++
 services/src/main/resources/META-INF/cxs/events/form.json         | 8 ++++++++
 services/src/main/resources/META-INF/cxs/events/goal.json         | 4 ++++
 services/src/main/resources/META-INF/cxs/events/identify.json     | 4 ++++
 .../src/main/resources/META-INF/cxs/events/incrementInterest.json | 4 ++++
 services/src/main/resources/META-INF/cxs/events/login.json        | 8 ++++++++
 .../src/main/resources/META-INF/cxs/events/modifyConsent.json     | 8 ++++++++
 .../src/main/resources/META-INF/cxs/events/profileDeleted.json    | 4 ++++
 .../src/main/resources/META-INF/cxs/events/profileUpdated.json    | 4 ++++
 services/src/main/resources/META-INF/cxs/events/ruleFired.json    | 4 ++++
 services/src/main/resources/META-INF/cxs/events/search.json       | 4 ++++
 .../src/main/resources/META-INF/cxs/events/sessionCreated.json    | 4 ++++
 .../src/main/resources/META-INF/cxs/events/sessionReassigned.json | 4 ++++
 .../src/main/resources/META-INF/cxs/events/updateProperties.json  | 4 ++++
 services/src/main/resources/META-INF/cxs/events/view.json         | 8 ++++++++
 16 files changed, 84 insertions(+)

diff --git a/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json b/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json
index 4ba8929..ef8dab2 100644
--- a/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json
+++ b/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json
@@ -14,6 +14,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/articleCompleted.json b/services/src/main/resources/META-INF/cxs/events/articleCompleted.json
index cc73736..9e31662 100644
--- a/services/src/main/resources/META-INF/cxs/events/articleCompleted.json
+++ b/services/src/main/resources/META-INF/cxs/events/articleCompleted.json
@@ -18,6 +18,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
@@ -48,6 +52,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/form.json b/services/src/main/resources/META-INF/cxs/events/form.json
index ace03f5..4551168 100644
--- a/services/src/main/resources/META-INF/cxs/events/form.json
+++ b/services/src/main/resources/META-INF/cxs/events/form.json
@@ -18,6 +18,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
@@ -48,6 +52,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/goal.json b/services/src/main/resources/META-INF/cxs/events/goal.json
index 57a3f9f..11468cc 100644
--- a/services/src/main/resources/META-INF/cxs/events/goal.json
+++ b/services/src/main/resources/META-INF/cxs/events/goal.json
@@ -18,6 +18,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "campaignId",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/identify.json b/services/src/main/resources/META-INF/cxs/events/identify.json
index 0842972..1fb001d 100644
--- a/services/src/main/resources/META-INF/cxs/events/identify.json
+++ b/services/src/main/resources/META-INF/cxs/events/identify.json
@@ -18,6 +18,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/incrementInterest.json b/services/src/main/resources/META-INF/cxs/events/incrementInterest.json
index 0ec4bd3..8604990 100644
--- a/services/src/main/resources/META-INF/cxs/events/incrementInterest.json
+++ b/services/src/main/resources/META-INF/cxs/events/incrementInterest.json
@@ -24,6 +24,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/login.json b/services/src/main/resources/META-INF/cxs/events/login.json
index 8d146c7..4e66255 100644
--- a/services/src/main/resources/META-INF/cxs/events/login.json
+++ b/services/src/main/resources/META-INF/cxs/events/login.json
@@ -14,6 +14,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
@@ -44,6 +48,10 @@
           "type": "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId": "scope",
           "type": "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/modifyConsent.json b/services/src/main/resources/META-INF/cxs/events/modifyConsent.json
index 6cee059..5eec0bf 100644
--- a/services/src/main/resources/META-INF/cxs/events/modifyConsent.json
+++ b/services/src/main/resources/META-INF/cxs/events/modifyConsent.json
@@ -14,6 +14,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
@@ -44,6 +48,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/profileDeleted.json b/services/src/main/resources/META-INF/cxs/events/profileDeleted.json
index c1030ac..62fed55 100644
--- a/services/src/main/resources/META-INF/cxs/events/profileDeleted.json
+++ b/services/src/main/resources/META-INF/cxs/events/profileDeleted.json
@@ -14,6 +14,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/profileUpdated.json b/services/src/main/resources/META-INF/cxs/events/profileUpdated.json
index 424ac28..78c675a 100644
--- a/services/src/main/resources/META-INF/cxs/events/profileUpdated.json
+++ b/services/src/main/resources/META-INF/cxs/events/profileUpdated.json
@@ -14,6 +14,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/ruleFired.json b/services/src/main/resources/META-INF/cxs/events/ruleFired.json
index 601b793..2a0f4c6 100644
--- a/services/src/main/resources/META-INF/cxs/events/ruleFired.json
+++ b/services/src/main/resources/META-INF/cxs/events/ruleFired.json
@@ -18,6 +18,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "linkedItems",
           "type" : "string",
           "multivalued" : true
diff --git a/services/src/main/resources/META-INF/cxs/events/search.json b/services/src/main/resources/META-INF/cxs/events/search.json
index 5e60f64..94fb45c 100644
--- a/services/src/main/resources/META-INF/cxs/events/search.json
+++ b/services/src/main/resources/META-INF/cxs/events/search.json
@@ -36,6 +36,10 @@
           "type": "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId": "scope",
           "type": "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/sessionCreated.json b/services/src/main/resources/META-INF/cxs/events/sessionCreated.json
index 1424c28..0d27647 100644
--- a/services/src/main/resources/META-INF/cxs/events/sessionCreated.json
+++ b/services/src/main/resources/META-INF/cxs/events/sessionCreated.json
@@ -14,6 +14,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json b/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json
index 3ec72ab..d69801b 100644
--- a/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json
+++ b/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json
@@ -18,6 +18,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/updateProperties.json b/services/src/main/resources/META-INF/cxs/events/updateProperties.json
index d4de20c..2be02f4 100644
--- a/services/src/main/resources/META-INF/cxs/events/updateProperties.json
+++ b/services/src/main/resources/META-INF/cxs/events/updateProperties.json
@@ -44,6 +44,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
diff --git a/services/src/main/resources/META-INF/cxs/events/view.json b/services/src/main/resources/META-INF/cxs/events/view.json
index 798e24c..a07398f 100644
--- a/services/src/main/resources/META-INF/cxs/events/view.json
+++ b/services/src/main/resources/META-INF/cxs/events/view.json
@@ -18,6 +18,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },
@@ -48,6 +52,10 @@
           "type" : "string"
         },
         {
+          "itemId" : "customItemType",
+          "type" : "string"
+        },
+        {
           "itemId" : "scope",
           "type" : "string"
         },