You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@unomi.apache.org by Aneesha Kaushal <an...@sitecore.com> on 2022/07/19 05:30:22 UTC

Action not running

Hello all,

I am new to Unomi and started testing it out.

I created profiles, and sessions and all were created successfully. I was able to run the below query as well to get the count of profiles matching the condition specified. All is working great, it returned the count of matching profiles.

curl -X POST http://localhost:8181/cxs/query/profile/count \
--user karaf:karaf \
-H "Content-Type: application/json" \
-d @- <<'EOF'
{
    "parameterValues": {
      "subConditions": [
        {
          "parameterValues": {
            "propertyName": "properties.firstName",
            "comparisonOperator": "exists"
          },
          "type": "profilePropertyCondition"
        }
      ],
      "operator" : "and"
    },
    "type": "booleanCondition"
},
EOF

But when I use this condition in a rule, I don't see action running as expected. The profile is still the same, the new property is not added to it.

Rule:

curl -X POST http://localhost:8181/cxs/rules/ \
--user karaf:karaf \
-H "Content-Type: application/json" \
-d @- <<'EOF'
{
  "metadata": {
    "id": "eligibilityRule",
    "name": "Example eligibility rule",
    "description": "Profile annualIncome < 12000"
  },
  "condition": {
    "parameterValues": {
      "subConditions": [
        {
          "parameterValues": {
            "propertyName": "properties.firstName",
            "comparisonOperator": "exists"
          },
          "type": "profilePropertyCondition"
        }
      ],
      "operator" : "and"
    },
    "type": "booleanCondition"
},
  "actions": [
    {
      "parameterValues": {
        "setPropertyName": "properties.eligibility",
        "setPropertyValue": "yes"
      },
      "type": "setPropertyAction"
    }
  ]
}
EOF

Profile after running the rule:


ip-192-168-1-28:log anek$ curl  --user karaf:karaf -X GET http://localhost:8181/cxs/profiles/101

{"itemId":"101","itemType":"profile","version":1,"properties":{"firstName":"Aneesha","lastName":"Kaushal"},"systemProperties":{"lastUpdated":"2022-07-19T02:02:02Z"},"segments":[],"scores":{},"mergedWith":null,"consents":{}}

I was expecting that new property eligibility should be added to the profile but the profile was not updated.

Can you help me understand what am I missing?

This message and its attachments are for the designated recipient only and may contain proprietary or otherwise confidential information. If you have received this message in error, please notify the sender immediately and delete the original. Any other sharing, copying or use of this message by you is strictly prohibited.