Add support for unique aspects without requiring ECInstanceId
#45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR brings the API of
ElementAspectNode
closer to the other nodes that create elements with navigation properties.Keep in mind that
ElementAspectNode
only supports the creation of unique aspects. Tracking the provenance ofbis:ElementMultiAspect
is trickier and not really doable without changes to the iTwin APIs.fir
doesn't make any attempt to do so and just reinserts all aspects attached to an element.As originally written, the connector author has to intervene in the DMO and specify the
ECInstanceId
of the element to attach the unique aspect to. Now there's an optionalelementAttr
inElementAspectDMO
. It's optional to allow compatibility with the old API, which means if you forget to specify bothelementAttr
and theelement
property of your node PCF will throw at runtime. If we can confirm anyone isn't using the old API (very likely) I'd like to drop it.I've also made changes to the synchronization of aspects to properly track the provenance of an aspect if it attaches itself to a different element. This solution is a hack, but I have a PR open to discuss alternatives.