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
60 stars 86 forks source link

Remove expressionLanguage fields from templates #1384

Closed mapedraza closed 1 year ago

mapedraza commented 1 year ago

After removing expressionLanguage, should those fields be removed from the following files?

https://github.com/telefonicaid/iotagent-node-lib/blob/2f87e77240a722c2dcd9d0db9f2b064db9343afc/lib/templates/createDevice.json#L39-L42

https://github.com/telefonicaid/iotagent-node-lib/blob/2f87e77240a722c2dcd9d0db9f2b064db9343afc/lib/templates/createDeviceLax.json#L39-L42

https://github.com/telefonicaid/iotagent-node-lib/blob/1e31766d876a7b0d720a08984ca82f27440a9e59/lib/templates/deviceGroup.json#L40-L43

https://github.com/telefonicaid/iotagent-node-lib/blob/1e31766d876a7b0d720a08984ca82f27440a9e59/lib/model/Device.js#L30-L57

https://github.com/telefonicaid/iotagent-node-lib/blob/1e31766d876a7b0d720a08984ca82f27440a9e59/lib/services/groups/groupRegistryMongoDB.js#L39-L62

CC: @AlvaroVega

AlvaroVega commented 1 year ago

expressionLanguage has not being removed completely. expressionLanguage is still part of model of Devices, Groups, an checked in some many places of the library:

https://github.com/telefonicaid/iotagent-node-lib/blob/1e31766d876a7b0d720a08984ca82f27440a9e59/lib/model/Device.js#L54 https://github.com/telefonicaid/iotagent-node-lib/blob/1e31766d876a7b0d720a08984ca82f27440a9e59/lib/services/devices/deviceService.js#L181

But anyway we can remove all references to expresionLanguage, even in model assuming that always is jexl

fgalan commented 1 year ago

expressionLanguage has not being removed completely. expressionLanguage is still part of model of Devices, Groups, an checked in some many places of the library:

In my opinion, it should be removed in these cases. It doesn't make sense to have a field which value can take only one possibility. That's equivalent to not having the field, which is a much simpler solution.

@mapedraza maybe you could propose a PR with such removel to see how it likes?

mapedraza commented 1 year ago

Solved by https://github.com/telefonicaid/iotagent-node-lib/pull/1398