Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/explicit attributes true: just measures in active attrs and active attrs with expressions #1355

Conversation

AlvaroVega
Copy link
Member

@AlvaroVega AlvaroVega commented Apr 28, 2023

  • Add more tests about explicitAttributes: true

@AlvaroVega AlvaroVega changed the title Fix/explicit attributes just measures in active attrs and active attrs with expressions Fix/explicit attributes true: just measures in active attrs and active attrs with expressions May 3, 2023
@AlvaroVega AlvaroVega requested a review from fgalan May 3, 2023 14:31
Copy link
Collaborator

@mapedraza mapedraza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…ctive_attrs_and_active_attrs_with_expressions
@@ -1,2 +1,3 @@
- Fix: explicitAttributes true case: should progress just active attributes which receives measures and all active attributes with expressions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behaviour match the one described in documentation?

Copy link
Collaborator

@mapedraza mapedraza May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to this:

### Explicitly defined attributes (explicitAttrs)
If a given measure element (object_id) is not defined in the mappings of the device or group provision, the measure is
stored in the Context Broker by adding a new attribute to the entity with the same name of the undefined measure
element. By adding the field `explicitAttrs` with `true` value to device or group provision, the IoTAgent rejects the
measure elements that are not defined in the mappings of device or group provision, persisting only the one defined in
the mappings of the provision. If `explicitAttrs` is provided both at device and group level, the device level takes
precedence. Additionally `explicitAttrs` can be used to define which meassures (identified by their attribute names, not
by their object_id) defined in JSON/JEXL array will be propagated to NGSI interface.

the IoTAgent rejects the measure elements that are not defined in the mappings of device or group provision

From my perspective, yes, it involves that case (since they are defined in the provision)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/advanced-topics.md#explicitly-defined-attributes-explicitattrs

Case 2:

"explicitAttrs": true

just measures defined in active, static (plus conditionally TimeInstant) will be propagated to NGSI interface.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, no further changes required in the documentation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NTC

…ctive_attrs_and_active_attrs_with_expressions
Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fgalan fgalan merged commit a047d00 into master May 4, 2023
@fgalan fgalan deleted the fix/explicit_attributes_just_measures_in_active_attrs_and_active_attrs_with_expressions branch May 4, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants