telefonicaid / iotagent-node-lib

Module to enable IoT Agent developers to build custom agents for their devices that can easily connect to NGSI Context Brokers
https://iotagent-node-lib.rtfd.io/
GNU Affero General Public License v3.0
59 stars 84 forks source link

Corner cases provisioning `entityNameExp` #1345

Open mapedraza opened 1 year ago

mapedraza commented 1 year ago

There are 3 cases when provisioning a service group using the parameter entityNameExp

When "entityNameExp":true

  {
    "id": "true",
    "type": "Light",
    "TimeInstant": {
      "type": "DateTime",
      "value": "2023-04-24T16:23:55.352Z",
      "metadata": {}
    }
  },

When "entityNameExp":false

  {
    "id": "Light:gps1",
    "type": "Light",
    "TimeInstant": {
      "type": "DateTime",
      "value": "2023-04-24T16:25:32.707Z",
      "metadata": {}
    }
  },

When "entityNameExp":"patata"

  {
    "id": "Light:gps1",
    "type": "Light",
    "TimeInstant": {
      "type": "DateTime",
      "value": "2023-04-24T16:27:54.134Z",
      "metadata": {}
    }
  },

When "entityNameExp":42

  {
    "id": "42",
    "type": "Light",
    "TimeInstant": {
      "type": "DateTime",
      "value": "2023-04-25T07:50:11.067Z",
      "metadata": {}
    }
  },
fgalan commented 1 year ago

Test also:

"entityNameExp": 0 "entityNameExp": null "entityNameExp": "'patata'"

fgalan commented 1 year ago

Seems to be coherent with JEXL parsing heaviours. In this case, this issue is just explaining these special cases in documentation.