[ 
https://issues.apache.org/jira/browse/UNOMI-366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17167762#comment-17167762
 ] 

Serge Huber commented on UNOMI-366:
-----------------------------------

Currently interests are incremented in a custom rule such as : 

{code}
{
  "metadata": {
    "id": "_ynqbd6g4t_incrementInterests",
    "name": "Increment profile interests",
    "description": "Evaluate segments when a profile is modified"
  },
  "raiseEventOnlyOnceForSession": true,
  "condition": {
    "parameterValues": {
      "subConditions": [
        {
          "type": "pageViewEventCondition",
          "parameterValues": {
          }
        },
        {
          "type": "eventPropertyCondition",
          "parameterValues": {
            "propertyName": "target.properties.interests",
            "comparisonOperator": "exists"
          }
        }
      ],
      "operator": "and"
    },
    "type": "booleanCondition"
  },
  "actions": [
    {
      "parameterValues": {
        "setPropertyName": "properties.interests",
        "setPropertyValue": "script::r = profile.properties['interests']; 
foreach(interest : event.target.properties['interests'].entrySet()) { if (r == 
null) { r = [interest.key: interest.value] } else if (r[interest.key] != null) 
{ r[interest.key] = r[interest.key] + interest.value } else { r[interest.key] = 
interest.value } } r",
        "storeInSession": false
      },
      "type": "setPropertyAction"
    }
  ]
}
{code}

We should replace this with a new incrementInterests built-in event type & 
replace the script with a new IncrementInterestAction that would do the 
following:

- (optional) check if topic exists to allow enforcement of only accepting 
existing topics
- increment the interest
- update scoring

> Implement increment interest event type & action
> ------------------------------------------------
>
>                 Key: UNOMI-366
>                 URL: https://issues.apache.org/jira/browse/UNOMI-366
>             Project: Apache Unomi
>          Issue Type: Sub-task
>            Reporter: Serge Huber
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to