You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by "Kevan Jahanshahi (Jira)" <ji...@apache.org> on 2022/06/23 13:52:00 UTC

[jira] [Closed] (UNOMI-588) Refacto the IncrementInterests action and rule

     [ https://issues.apache.org/jira/browse/UNOMI-588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevan Jahanshahi closed UNOMI-588.
----------------------------------
    Resolution: Won't Fix

The incrementInterests logic in Unomi is not applicable to the profile properties.interests and should be rework, the current implem is not correct (contains bugs) and do not respect the spec.

> 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
>            Assignee: Kevan Jahanshahi
>            Priority: Major
>             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)