Skip to content

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.

4 participants