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

Serge Huber updated UNOMI-366:
------------------------------
    Description: 
Currently interests are incremented in a custom rule such as : 

{code}
{
  "metadata": {
    "id": "_ynqbd6g4t_incrementInterests",
    "name": "Increment profile interests",
    "description": "Increment profile interests when a page is viewed"
  },
  "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

Interests inside profiles:

{code}
properties : {
  interests : {
    topic : double
  }
} 
{code}

Global configuration setting to setup min/max and relative value

min: 0
max: 150
divider: 100

So to calculate a cdp_interests we would to :

interest_value = properties.interests.topic1 / divider



  was:
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

Interests inside profiles:

{code}
properties : {
  interests : {
    topic : double
  }
} 
{code}

Global configuration setting to setup min/max and relative value

min: 0
max: 150
divider: 100

So to calculate a cdp_interests we would to :

interest_value = properties.interests.topic1 / divider




> 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
>            Assignee: Serge Huber
>            Priority: Major
>
> Currently interests are incremented in a custom rule such as : 
> {code}
> {
>   "metadata": {
>     "id": "_ynqbd6g4t_incrementInterests",
>     "name": "Increment profile interests",
>     "description": "Increment profile interests when a page is viewed"
>   },
>   "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
> Interests inside profiles:
> {code}
> properties : {
>   interests : {
>     topic : double
>   }
> } 
> {code}
> Global configuration setting to setup min/max and relative value
> min: 0
> max: 150
> divider: 100
> So to calculate a cdp_interests we would to :
> interest_value = properties.interests.topic1 / divider



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

Reply via email to