Kevan Jahanshahi created UNOMI-588:
--------------------------------------

             Summary: Refacto the IncrementInterests action and rule
                 Key: UNOMI-588
                 URL: https://issues.apache.org/jira/browse/UNOMI-588
             Project: Apache Unomi
          Issue Type: New Feature
    Affects Versions: 2.0.0
            Reporter: Kevan Jahanshahi
             Fix For: 2.0.0


Due to Data structure changes in 
https://issues.apache.org/jira/browse/UNOMI-585 

The interests are now using the flattenedProperties on the event side:
{code:java}
{
  "eventType":"incrementInterests",
  "scope":"dummy_scope",
  "flattenProperties": {
    "interests": {
      "cars": 15,
      "football": 56
    }
  }
} {code}
And they are stored as nested Object on the profile:
{code:java}
"interests": [{
  "key": "cars",
  "value": 15
}, {
  "key": "football",
  "value": 56
}] {code}
So we need to update the IncrementInterestAction: 
[https://github.com/apache/unomi/blob/1e0a8983cabd6f244c26d516c834bf90c0faccde/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java]
 * The action should now read the interests from the flattenProperties of the 
event: event.flattenedProperties.interests.
 * The action should now store the result of the increment in the profile as 
nested structure like the example bellow.

Also consider updating the Integration test if necessary to respect the new 
data structure of the incoming event.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to