I had to change Id64.isInvalid to !Id64.EntityReferences, because Id64.isInvalid sees "e0" as valid id.
The problem was, that IModelCloneContext was trying to find relationship's target or source element that does not exist in the target iModel. So when findTargetEntityId returns "e0" for element referenced by relationship it would pass if statement with Id64.isInvalid and transformer would crash because ECSqlStatement.bindId can't bind invalid64Id.
Now IModelCloneContext.findTargetEntityId will return invalid id for target iModel relationship.
I had to change![image](https://github.com/iTwin/imodel-transformer/assets/51540204/6ba9ad9b-9a51-4652-9a2f-f2e58d4ca2a7)
Id64.isInvalid
to!Id64.EntityReferences
, becauseId64.isInvalid
sees "e0" as valid id.The problem was, that
IModelCloneContext
was trying to find relationship's target or source element that does not exist in the target iModel. So whenfindTargetEntityId
returns "e0" for element referenced by relationship it would pass if statement withId64.isInvalid
and transformer would crash becauseECSqlStatement.bindId
can't bind invalid64Id.Now
IModelCloneContext.findTargetEntityId
will return invalid id for target iModel relationship.