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

Update Relationships with ContextBrokerClient update_entity #145

Closed
dnikolay-ebc opened this issue May 18, 2022 · 6 comments · Fixed by #271
Closed

Update Relationships with ContextBrokerClient update_entity #145

dnikolay-ebc opened this issue May 18, 2022 · 6 comments · Fixed by #271
Assignees
Labels
question Further information is requested

Comments

@dnikolay-ebc
Copy link

Describe the bug
ContextBrokerClient -> update_entity calls update_or_append_entity_attributes with attrs=entity.get_properties().
This has the consequence that all relationships, even newly created ones, are ignored.

Is there any reason why update_entity is not using entity.get_attributes()?

@dnikolay-ebc dnikolay-ebc added the bug Something isn't working label May 18, 2022
@tstorek
Copy link
Collaborator

tstorek commented May 19, 2022

@dnikolay-ebc I can look into it but I think that this is intended behavior because we see relationships as rather static that should not be updated by bulk operations. Especially, since incomplete updates would accidentally overwrite existing information. If you want to update them you can use one of the other functions provided. I already explained this a little here #92.

@tstorek
Copy link
Collaborator

tstorek commented Jul 6, 2022

@dnikolay-ebc can we close this?

@tstorek tstorek added question Further information is requested and removed bug Something isn't working labels Aug 12, 2022
@tstorek tstorek closed this as completed Aug 12, 2022
@tstorek tstorek reopened this Aug 12, 2022
@tstorek
Copy link
Collaborator

tstorek commented Aug 12, 2022

@dnikolay-ebc please, reopen if required!

@tstorek tstorek closed this as completed Aug 12, 2022
@SBlechmann
Copy link
Contributor

@tstorek
we had a discussion about the update of relationships.

In our opinion, relationships are kind of static but we need the ability to adapt them - and not just with the workaround of first deleting them and creating a new one.
This is why we want to remove the protection.

Do you have any reason why we should not pursue this way?

@SBlechmann SBlechmann reopened this Jan 10, 2024
@tstorek
Copy link
Collaborator

tstorek commented Jan 15, 2024

@SBlechmann I think that the easiest way would be add an option the update_entity function to not accidentely overwrite the existing relationsships. Addtionally, probably a seperated function for update_entitiy_relationships and update_entitiy_properties.
update_entity can therafter simple combine the two of them. Sounds reasonable?

@SystemsPurge
Copy link
Collaborator

SystemsPurge commented Apr 12, 2024

@tstorek is there a reason why each of these functions update_entity, update_entity_relationships and update_entity_properties cannot call update_or_append_entity_attributes with attr=entity.get_attributes, attr=entity.get_relationships and attr=entity.get_properties respectively ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants