unomi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhagi Raj Limbu <ningwano...@gmail.com>
Subject Scores always shows 0 on profile
Date Mon, 30 Sep 2019 16:05:23 GMT
Hi,

I create a test rules and scoring through karaf console. I want to update scores on a new
user profile upon run events.

Here is a score:

curl -X POST http://localhost:8181/cxs/scoring \
--user karaf:karaf \
-H "Content-Type: application/json" \
-d @- <<'EOF'
{
  "metadata": {
    "id": "test-join-space-program-score",
    "name": "Test Space Program Score",
    "description": "Assign score to user profile when they join space program exploration"
  },
  "elements": [
    {
      "value": 3,
      "condition": {
        "type": "booleanCondition",
        "parameterValues": {
          "operator": "and",
          "subConditions": [
            {
              "type": "eventTypeCondition",
              "parameterValues": {
                "eventTypeId": "testAuthenticateUserContactInfoSubmitted"
              }
            }
          ]
        }
      }
    }
  ]
}
EOF
=============== rules (linked scoringId on profile) =======================
curl -X POST -k -u karaf:karaf https://localhost:9443/cxs/rules \
--user karaf:karaf \
--header "Content-Type: application/json" \
-d @- << EOF
{
  "metadata": {
    "id": "testScoreContactInfo",
    "name": "Demo Score Contact",
    "description": "Map event properties to profile properties"
  },
  "condition": {
    "parameterValues": {
      "subConditions": [
        {
          "parameterValues": {
            "eventTypeId": "testAuthenticateUserContactInfoSubmitted"
          },
          "type": "eventTypeCondition"
        }
      ],
      "operator": "and"
    },
    "type": "booleanCondition"
  },
  "actions": [
    {
      "parameterValues": {},
      "type": "allEventToProfilePropertiesAction"
    }
  ],
  "linkedItems": [
    "test-join-space-program-score"
  ]
}
EOF

======================= Run events to save a new profile ===============
curl -X POST http://localhost:8181/context.json?sessionId=0c5ec2ef-04a9-47a9-b2a3-0f7b3f7ef0fd
\
-H "Content-Type: application/json" \
-H "X-Unomi-Peer:670c26d1cc413346c3b2fd9ce65dab41" \
-d @- <<'EOF'
{
  "events": [
    {
      "eventType": "testAuthenticateUserContactInfoSubmitted",
      "scope": "my-test-space-program",
      "source": {
        "itemId": "spaceProgramRegistration-0001",
        "itemType": "space-explore-program-registration-page",
        "scope": "my-test-space-program"
      },
      "target": {
        "itemType": "space-explore-program-registration-page",
        "itemId": "spaceProgramRegistration-0001",
        "properties": {
          "preferredLanguage": "en",
          "firstName": "Jack",
          "lastName": "Daniel",
          "email": "jck.dan01@acme.com",
          "gender": "male",
          "leadAssignedTo": "true"
        }
      }
    }
  ],
  "requiredProfileProperties": ["*"],
  "requiredSessionProperties": ["*"]
}
EOF

================= end events ===================

After it runs events, it displays scores value 0. I want to display 3 instead of 0.

Did I miss something while creates a scoring?






   

Mime
View raw message