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

Add test for updating an element with multiple external aspects #57

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jackson-at-bentley
Copy link
Contributor

I'm trying to figure out why our call to updateAspect works without passing it an ID property. If you look at the source code for EntityProps it says the ID is mandatory.

If anyone knows how this call works please let me know. I assume it's related to an implementation detail of aspects. The aspect API has been confusing me for a while now.

if (itemState === ItemState.New) {
  this.imodel.elements.insertAspect(aspectProps); // throws on error
} else {
  this.imodel.elements.updateAspect(aspectProps); // <- ⁉
}

@jackson-at-bentley
Copy link
Contributor Author

Adam do you understand what's going on here? From aspect fundamentals,

For an ElementMultiAspect, the combination of subclass and the Element identity identifies a list of ElementMultiAspects. Every ElementMultiAspect also has a private Id if an individual ElementMultiAspect instance has to be referenced

bis:ExternalSourceAspect is a bis:ElementMultiAspect so we should have to provide its private Id unless the backend is fetching it with its provenance triple instead. Regardless the test seems okay.

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