1

We want to filter noification sent to Draco based on an attribute an "devicetime". Only when this attribute is not blank, we want to send data to Draco. How do we achieve this in Draco Subscription. I tried many combinations in expression, but nothing worked. Can you please help here:

curl -iX POST \
  'http://52.172.34.29:1026/v2/subscriptions?options=skipInitialNotification' \
  -H 'Content-Type: application/json' \
  -H 'fiware-service: openiot' \
  -H 'fiware-servicepath:  /' \
  -d '{
  "description": "Subscription",
  "subject": {
    "entities": [
      {
        "idPattern": ".*"
      }
    ],
    "condition": {
      "attrs": [],
      "expression":{"q":"devicetime==.*"}
    }
  },
  "notification": {
    "http": {
      "url": "http://52.172.34.29:3003/v2/notify"
    },
    "attrs": [],
    "onlyChangedAttrs":true,
    "throttling": 5
  }
}'
Kavipriya M
  • 131
  • 5

1 Answers1

1

as per the NGSIv2 specification: Unary negatory statements use the unary operator !, while affirmative unary statements use no operator at all. The unary statements are used to check for the existence of the target property. E.g. temperature matches entities that have an attribute called 'temperature' (no matter its value), while !temperature matches entities that do not have an attribute called 'temperature'.

so you should fix it with

"expression":{"q":"devicetime"}