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

Serge Huber commented on UNOMI-171:
-----------------------------------

Hello Mitesh, 

Is there a reason why you didn't post this in the mailing list ? If you have a 
problem with it I'd like to know because we do want to encourage users, not 
discourage them.

The big problem with the Apache Jira is that we don't really have a category 
for "questions" such as your which is why I suggested that you post it in the 
mailing list instead.

Anyway, to answer your initial question it looks like it should work, usually 
the trick to get right is to have the proper scope on the rule to match the 
event but it looks right. 

Usually when I have such a problem I either enabled debugging on the rule 
service, which you can do with the
{code:java}
log:set debug org.apache.unomi.services.services{code}
Karaf shell command or I connect a debugger on port 5000 after starting karaf 
with
{code:java}
./karaf debug{code}
Regards,

  Serge... 

> REST API: When Event is triggered, Rule is not setting property value
> ---------------------------------------------------------------------
>
>                 Key: UNOMI-171
>                 URL: https://issues.apache.org/jira/browse/UNOMI-171
>             Project: Apache Unomi
>          Issue Type: Test
>          Components: core
>    Affects Versions: 1.3.0-incubating
>            Reporter: Mitesh Jain
>            Assignee: Serge Huber
>            Priority: Minor
>
> Hi,
> I had installed Unomi 1.3.0
> Elastic Search: 5.6.3 with cluster.name: contextElasticSearch
> Karaf is running successfully.
> Following steps I tried to, call a event and execute rules agains it and set 
> the property value
>  # I had created new property called "categoryLastVisitedID" through Rest 
> API, created property below:
> {code:java}
> {
>   "itemId": "categoryLastVisitedID",
>   "itemType": "propertyType",
>   "version": 8,
>   "target": "profiles",
>   "defaultValue": null,
>   "dateRanges": [
>   ],
>   "numericRanges": [
>   ],
>   "ipRanges": [
>   ],
>   "automaticMappingsFrom": [
>   ],
>   "rank": null,
>   "mergeStrategy": null,
>   "multivalued": null,
>   "protected": false,
>   "metadata": {
>     "id": "categoryLastVisitedID",
>     "name": "categoryLastVisitedID",
>     "description": null,
>     "scope": "systemCore",
>     "tags": [
>     ],
>     "systemTags": [
>       "profileProperties",
>       "properties",
>       "systemProfileProperties"
>     ],
>     "enabled": true,
>     "missingPlugins": false,
>     "hidden": false,
>     "readOnly": false
>   },
>   "type": "integer"
> {code}
> 2. I had created a new rule called "profileCategoryUpdate" through Rest API, 
> shown below
> {code:java}
> {
>   "itemId": "profileCategoryUpdate",
>   "itemType": "rule",
>   "version": 23,
>   "condition": {
>     "parameterValues": {
>       "eventTypeId": "categoryVisit"
>     },
>     "type": "eventTypeCondition"
>   },
>   "actions": [
>     {
>       "parameterValues": {
>         "setPropertyName": "properties.categoryLastVisitedID",
>         "setPropertyValue": "1",
>         "storeInSession": false
>       },
>       "type": "setPropertyAction"
>     }
>   ],
>   "linkedItems": null,
>   "raiseEventOnlyOnceForProfile": false,
>   "raiseEventOnlyOnceForSession": false,
>   "priority": 0,
>   "metadata": {
>     "id": "profileCategoryUpdate",
>     "name": "Category assigned to a profile",
>     "description": "Update profile category information",
>     "scope": "systemCore",
>     "tags": [
>       
>     ],
>     "systemTags": [
>       
>     ],
>     "enabled": true,
>     "missingPlugins": false,
>     "hidden": false,
>     "readOnly": true
>   }
> {code}
> 3. I had triggered event from angular application, with event type: 
> "categoryVisit" which is matching the rule created above, and also action 
> setting the "categoryLastVisitedID" to 1, but profile is not getting the 
> property "categoryLastVisitedID"
>  Event triggered given below:
> {code:java}
> {
>  "itemId": "d1ba896d-fa6a-4598-aaa1-497c5e7b6fad",
>  "itemType": "event",
>  "scope": "systemCore",
>  "version": 1,
>  "eventType": "categoryVisit",
>  "sessionId": "ef9150af-346d-42aa-bb48-d19afa2b8f17",
>  "profileId": "e2dfd376-8e13-4209-a1f3-b56a86548a3d",
>  "timeStamp": "2018-03-12T13:46:19Z",
>  "properties": {
> },
>  "source": {
>  "itemId": "aHR0cDovL2xvY2FsaG9zdDo1NTU2L2NhdGVnb3J5L2VwaWN1cmVhbg==",
>  "itemType": "page",
>  "scope": "systemscope",
>  "version": null,
>  "properties":
> { "url": "[http://localhost:5556/category/epicurean]";, "categoryId": 42 }
> },
>  "target": null
>  }
> {code}
>  
> Please let me know, If I am doing anything wrong, as I am not able to set the 
> property "categoryLastVisitedID" for a profile ?
> Thanks,
> Mitesh Jain



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to