You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by "Serge Huber (Jira)" <ji...@apache.org> on 2020/07/30 09:05:00 UTC
[jira] [Updated] (UNOMI-366) Implement increment interest event
type & action
[ 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": "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
>
> 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
--
This message was sent by Atlassian Jira
(v8.3.4#803005)